%% SL. 17
sprintf('Value of pi is %0.5f, value of 5*pi is %0.5f.', pi, 5*pi)
x = 50;
sprintf('This is %d%%', x)
tx = 'test_A';
sprintf('This is a measurement set: %s', tx)

%% SL. 24
s = 'Do what you can, with what you have, where you are.'
s(s ~= ' ')
s(s > ' ')
s(s > 32)
replace(s, ' ', '')
nYou = length(strfind(s, 'you'))

%% SL. 41
M = @(x)[sin(x), cos(x)];
% Saving
fileID = fopen('testFile.txt','w+');
fprintf(fileID, '%s\n', func2str(M));
fclose(fileID);
% Loading
fileID = fopen('testFile.txt','r');
A = fgetl(fileID);
fclose(fileID);
% Evaluation
M = str2func(A)
M(1)

%% SL. 50
st = 'how are you?';
length(strfind(st, ' '))
sum(st == ' ')

st = 'MATLAB is CaSe sEnSiTiVe!!!';
st = lower(st)
length(st)

