MATLAB Classes and Object-Oriented Programming
313Pages

{{requestButtons}}

Catalog excerpts

MATLAB Classes and Object-Oriented Programming - 194

PropertiesStoringClassData iferIn>=0&&erIn<=100erIn=erIn.*obj.scalingFactor obj.expectedResult=erIn;elseobj.expectedResult=NaN;endend functioner=get.expectedResult(obj)er=obj.expectedResult/scalingFactor;endendend 6-16 >

Open the catalog to page 194
MATLAB Classes and Object-Oriented Programming - 231

ImplementingOperatorsforYourClass OperationMethodtoDefineDescription > a&band(a,b) LogicalAND > a|bor(a,b) LogicalOR > ~anot(a) LogicalNOT > a:d:ba:bcolon(a,d,b)colon(a,b) Colonoperator > a'ctranspose(a) Complexconjugatetranspose > a.'transpose(a) Matrixtranspose > commandwindowoutputdisplay(a) Displaymethod > [ab]horzcat(a,b,...) Horizontalconcatenation > [a;b]vertcat(a,b,...) Verticalconcatenation > a(s1,s2,...sn)subsref(a,s) Subscriptedreference > a(s1,...,sn)=bsubsasgn(a,s,b) Subscripted assignment > b(a)subsindex(a) Subscriptindex >

Open the catalog to page 231
MATLAB Classes and Object-Oriented Programming - 296

DesigningRelatedClasses DocStockClassProperties NameClassDefaultDescription > NumSharesdouble0 Numberofsharesofaparticularstock > SharePricedouble0 Currentvalueofasset PropertiesInheritedfromtheDocAssetClass > Descriptionchar'' Descriptionofasset > CurrentValuedouble0 Currentvalueofasset > Datechardate Datewhenrecordiscreated (setby > date function) > Typechar'' Typeofasset(stock,bond, savings) Thefollowingtablesummarizesthemethodsforthe > DocStock class. DocStockClassMethods NameDescription > DocStock Classconstructor > disp Displaysinformationabouttheobject > The > < symbolspecifiesthe >...

Open the catalog to page 296

All The MathWorks catalogs and technical brochures

  1. Stateflow

    8 Pages

  2. SimEvents

    7 Pages

  3. SimDriveline

    7 Pages

  4. SimRF

    6 Pages

  5. MATLAB Coder

    5 Pages

  6. OPC Toolbox

    5 Pages

  7. SimBiology

    6 Pages

  8. xPC Target

    5 Pages

  9. SimMechanics

    7 Pages

  10. Simscape

    7 Pages

  11. Simulink

    6 Pages

  12. MATLAB®

    6 Pages

Archived catalogs

  1. Graphics

    667 Pages

  2. Data Analysis

    220 Pages

  3. Mathematics

    316 Pages