So after the first running around MATLAB command window you should be familiar how it works as a calculator..if not just try all Mathematical operations lie + - * / ^..anything... as long as syntax is correct MATLAB should give an out put like
>> ans =
Ok...now lets get in to the business of matrices.
I hope everyone knows what a Matrix is...if not it looks something like this...
A= 2 3 4
2 3 3
Well, how do you put this in to Matlab?
its easy... just type
A=[2 3 4; 2 3 3]
this should give you an output like this
Now you might know a set of operations to be done on matrices... well its time to get that started...
First Addition of Matrices
A=[2 3 4; 2 3 3];
B=[1 3 4; 1 3 3];
A+B
gives the output
>> ans =
3 6 8
3 6 6
Just like these try using Subtraction, multiplication ...
But in order to multiply 2 matrices there is a rule you have to follow that... the rule is as follows
"In order to multiply 2 matrices A and B , the order of A being i*j , then the order of B must be j*k"
Meaning the number of columns in "A" should be equal to number of rows in "B" .... Its easy ... :)
Try them out until my next post...
So long!
>> ans =
Ok...now lets get in to the business of matrices.
I hope everyone knows what a Matrix is...if not it looks something like this...
A= 2 3 4
2 3 3
Well, how do you put this in to Matlab?
its easy... just type
A=[2 3 4; 2 3 3]
this should give you an output like this
![]() |
See how beautifully Matlab gives the output |
First Addition of Matrices
A=[2 3 4; 2 3 3];
B=[1 3 4; 1 3 3];
A+B
gives the output
>> ans =
3 6 8
3 6 6
Just like these try using Subtraction, multiplication ...
But in order to multiply 2 matrices there is a rule you have to follow that... the rule is as follows
"In order to multiply 2 matrices A and B , the order of A being i*j , then the order of B must be j*k"
Meaning the number of columns in "A" should be equal to number of rows in "B" .... Its easy ... :)
Try them out until my next post...
So long!
No comments:
Post a Comment