






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!







x = [1, 2, 3, 4, 5, 6, 7]; y = ['a', 'b', 'c']; z = 'abc';
a = [2, 3, 5, 7, 11, 13]; a(1) % 2 a(2) % 3 a(3) % 5 a(6) % 13
s = 'Cornell' s(1) % 'C' s(4) % 'n'
'a':'e' % 'abcde' 'e':2:'k' % 'egik'
a = [2, 3, 5, 7, 11, 13]; a(1:2) % [2, 3] a(1:2:5) % [2, 5, 11] a(6:−3:1) % [13, 5] a(1:3:end) % [2, 7] a(2:end−1) % [3, 5, 7, 11]
% This will display values of x % at every iteration from 1 to 5 for x = 1: x end
% Sum integers from 1 to 100 s = 0; for j = 1: s = s + j; end fprintf('1+..+100=%d\n',s);
while %
while %
end
end