Display(hello); % After run. Display hello in command line.
A=input(); %input from user to the var.
Display(A); %display content of var A. fprintf(); % display content of var A.
Difference ? + addition - subtraction * multiplication / division ^ power complex conjugate transpose %not for our purpose.
Example:-
Output ?? end is closing of switch case. Similar to C. Closing of if , else statement is with end. Example:- for i=1:N .
end
while(condition) ..
end
function [A,B ] = Check( X,Y)
A=2*X; B=2*Y; end
OUTPUT=> [x,y]=Check(2,3) x=4 y=6; syms x y [x,y]=Check(2,3); display(x); display(y); Name of script file is chetan2.m Whenever in command window you type chetan2, the script code will be executed.
>> chetan2
x =
4
y =
6 Many things remains same as c E.g:- 1- break; 2-continue; 3- == 4- && BUT!!! 5- ! This is replaced by ~ 6-syms is used to define variable no use of int,float 7-zeros(1,N) create the matrix which has 1row and N column in which all element are zero A=zeros(5); Create the matrix of 5X5