Getting start with MATLAB
Launch MATLAB Software and type the following code on command prompt and check the output.
To initialize a scalar a:
>>a=[2]
To initialize a row vector b:
>>b=[1 2 3 4 5]
Note that spaces between numbers signify a new column.
To initialize a column vector c:
>>c=[6; 7; 8; 9]
Note that semicolons between numbers signify a new row.
To initialize a 3 by 3 matrix M:
>>M=[1 2 3; 4 5 6; 7 8 9]
Again, spaces between numbers signify a new column,
whereas semicolons signify a new row.
Comments
Post a Comment