


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8]
a = 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8
mx(m, n);
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8]; a(2,5)
ans = 6
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8]; v = a(:,4)
v = 4 5 6 7
a(:,m:n)
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8]; a(:, 2:3)
ans = 2 3 3 4 4 5 5 6
a = [ 1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7; 4 5 6 7 8]; a(:, 2:3)
ans = 2 3 3 4 4 5 5 6
Example
a = [ 1 2 3 ; 4 5 6; 7 8 9]; new_mat = a([2,3,2,3],:)
new_mat = 4 5 6 7 8 9 4 5 6 7 8 9