Posts

Showing posts from December, 2021
 MATLAB commands Summary of MATLAB Onramp Basic syntax Example Description x   =   pi Create variables with the equal sign ( = ). The left-side ( x ) is the variable name containing the value on the right-side ( pi ). y   =   sin ( -5 ) You can provide inputs to a function using parentheses.   Desktop management Function Example Description save save  data.mat Save your current workspace to a MAT-file. load load  data.mat Load the variables in a MAT-file to the Workspace. clear clear Clear all variables from the Workspace. clc clc Clear all text from the Command Window. format format  long Change how numeric output is displayed.   Array types Example Description 4 scalar [ 3   5 ] row vector [ 1 ; 3 ] column vector [ 3   4   5 ; 6   7   8 ] matrix   Evenly-spaced vectors Example Description 1 : 4 Create a vector from  1  to  4 , spaced by  1 , using the  colon ( : )  operator. 1 : 0.5 : 4 Create a vector from  1  to  4 , spaced by  0.5 . linspace ( 1 , 10 , 5 ) Create a vector with  5