harf_notu = 'BB';
switch(harf_notu)
case 'AA'
fprintf('Geçtin!\n' );
case 'BA'
fprintf('Geçtin\n' );
case 'BB'
fprintf('Geçtin\n' );
case 'CB'
fprintf('Geçtin\n' );
case 'CC'
fprintf('Geçtin\n' );
case 'DC'
fprintf('Geçtin\n' );
case 'DD'
fprintf('Sorumlu Geçtin\n' );
case 'FD'
fprintf('Kaldın\n' );
case 'FF'
fprintf('Kaldın\n' );
otherwise
fprintf('Geçersiz Harf Notu\n' );
end
Geçtin
x = [12 64 24];
plottype = 'pie3';
switch plottype
case 'bar'
bar(x)
title('Bar Graph Örneği')
case {'pie','pie3'}
pie3(x)
title('Pie Chart Örneği')
otherwise
warning('Tanımlanmayan Plot Tipi.')
end
sonuc = 52;
switch(sonuc)
case 52
disp('sonuc 52')
case {52, 78}
disp('sonuc 52 veya 78')
end
sonuc 52