Gistlib Logo

gistlib

getting type of a variable in matlab

You can use the class function in Matlab to get the data type of a variable. Here's an example:

main.m
a = 3;
class(a) % output will be 'double'
42 chars
3 lines

In this example, a is a variable of type double, which is why the class function returns the string 'double'.

similar matlab code snippets

add constant block data typed via back propagation on each inports at the root level of a simulink model in matlab
create branch code depending on variable type in matlab
how to calculate the 99th percentile in matlab
how to calculate the binomial distribution in matlab
how to calculate cumulative distribution function in matlab
how to perform a ztest in matlab
how to calculate the normal distribution in matlab
how to plot the binomial distribution in matlab
calculate the area of a triangle in matlab
calculate the area of a sphere in matlab

related categories

matlab
variables
data types
typeof
class

gistlibby LogSnag