Matlab: - Amal Prasad
Matlab: - Amal Prasad
•Amal Prasad
• Overwriting variable
• Once a variable has been created, it can be reassigned.
• If you do not wish to see the intermediate results, you can suppress
the numerical output by putting a semicolon (;) at the end of the line
• >>t = 5;
• >>t = t+1
t=
6
• Making corrections
• A previously typed command can be recalled with the up-arrow
key
• When the command is displayed at the command prompt, it
can be modified if needed and executed
A =
1 2 3
4 5 6
7 8 9
4 5 6
7 8 0
t =
1 2 3 4 5 6 7 8 9 10
• k =2:-0.5:-1
k =
2 1.5 1 0.5 0 -0.5 -1
• B = [1:4; 5:8]
x =
1 2 3 4
5 6 7 8
A(-2), A(0)
Error: ??? Subscript indices must either be real positive integers or logicals.
A(4,2)
Error: ??? Index exceeds matrix dimensions.
A = [ x y]
1 2 4 5
B = [x ; y]
1 2
4 5
C = [x y ;z]
Error:
??? Error using ==> vertcat CAT arguments dimensions are not consistent.
Given A and B:
x=1
while x <= 10
x = 3*x
end
• Contact information:
• amal.prasad2010@gmail.com
• +91-91790 40166