How to create a Matrix:-
enter all elements separated by space or coma & inclosed with [ ].
A=[1 2 3 4 5];
or
A=[1,2,3,4,5];
for coulmn matrix elements separated by semi colon ( ; )
A=[1;2;3;4;5]
A=[N:M]; create a row matrix with starting number N & last element M with the difference of "1".
A=[M:D:M]; create a row matrix with starting number N & last element M with the difference of "D".
A=zeros(R,C); create a matrix of "R" Row & "C" Column with all elements Zero.
A=ones(R,C); create a matrix of "R" Row & "C" Column with all elements One.
A=rand(R,C); create a matrix of "R" Row & "C" Column with Random Elements b/w 0 & 1 .
A=eye(R,C); create a Identity Matrix of "R" Row & "C" Column.
How to use editor:-
just type edit on comaand window & press enter.
enter all elements separated by space or coma & inclosed with [ ].
A=[1 2 3 4 5];
or
A=[1,2,3,4,5];
for coulmn matrix elements separated by semi colon ( ; )
A=[1;2;3;4;5]
A=[N:M]; create a row matrix with starting number N & last element M with the difference of "1".
A=[M:D:M]; create a row matrix with starting number N & last element M with the difference of "D".
A=zeros(R,C); create a matrix of "R" Row & "C" Column with all elements Zero.
A=ones(R,C); create a matrix of "R" Row & "C" Column with all elements One.
A=rand(R,C); create a matrix of "R" Row & "C" Column with Random Elements b/w 0 & 1 .
A=eye(R,C); create a Identity Matrix of "R" Row & "C" Column.
How to use editor:-
just type edit on comaand window & press enter.
you get a new window in which you can write your program or function.
save this file with .m extentation.
How to I/P any variable at run time:-
use input(' ') command for it in editor at the time of writing program.
A=input('enter the value of A');
How to I/P any variable at run time:-
use input(' ') command for it in editor at the time of writing program.
A=input('enter the value of A');
No comments:
Post a Comment