Data types

In Matlab variables can be many different things, the most frequent ones you will find are the following:

This example will create a symbolic variable with the exact value of one fifth

h = sym(1/5) 

This example will create 3 symbolic variables: x, y and z.

syms x y z

To figure out the data type of a variable you can use the whos function or look at the Workspace panel, the data type will be indicated under Class.

type

Dyson School of Design Engineering 2021 - Ivan Revenga Riesco