This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

@ -0,0 +1,36 @@
a=['123',0,' abc '];
b=['456',9];
c='789';
disp(a);
disp(b);
disp(c);
% string comparison
printf('(a==b) is %i\n',strcmp(a,b));
% string copying
A = a;
B = b;
C = c;
disp(A);
disp(B);
disp(C);
% check if string is empty
if (length(a)==0)
printf('\nstring a is empty\n');
else
printf('\nstring a is not empty\n');
end
% append a byte to a string
a=[a,64];
disp(a);
% substring
e = a(1:6);
disp(e);
% join strings
d=[a,b,c];
disp(d);