Posts

Showing posts with the label isa

How to check a type of specified variable is a specified type in MatLab? - isa -- MatLab

How to check a type of specified variable is a specified type in MatLab? - isa -- MatLab How to check a type of specified variable is a specified type in MatLab? [Ans] isa [description] <answer>=isa(<A>,<dataType>) <answer>=isa(<A>,<categoryType>) <answer>=isa(<A>,<dataType>) It will return true if type of <A> is the type <dataType> <answer>=isa(<A>,<categoryType>) It will return true if type of <A> belongs to the category <categoryType> more details on: Determine if input has specified data type - MATLAB isa (mathworks.com) code: clear clc typeS= 'float' ; inst1=56; isa(inst1,typeS) inst2=logical(1); isa(inst2,typeS) inst3=true; isa(inst3,typeS) inst4= 'A' ; isa(inst4,typeS) inst5=[4 5 6 'A' ]; isa(inst5,typeS) inst6={1,2,3, 'A' }; isa(inst6,typeS) result: ans = logical 1 ans = logical 0 ans = logical 0 ans = logical 0