(Ajay deleted the question so I (MF) am restoring it as best I can.)
I wrote this body of code:
function output = InteriorAngle(input)switch input (InteriorAngle)case 'triangle'disp ('180')case 'square'disp ('360');case 'pentagon'disp ('540');case 'hexagon'disp ('720');case 'heptagon'disp ('900');case 'octagon'disp ('1080');case 'nonagon'disp ('1260');case 'decagon'disp ('1440');otherwisedisp ('0');endendbut for some reason, it's not running when i input,in = cell(1,3);in{1,1} = 'triangle';in{1,2} = 'hexagon';in{1,3} = 'dodecagon';out = InteriorAngle(in)
what am i doing wrong?
Best Answer