why will the area only work for the circle and not the other shapes
1 view (last 30 days)
when i run the code and type 'circle' when prompted the code works and finds the area, when i type rectangle or cylinder i get an error message telling me there is a problem with line 3. this is the first time i have used mathlab and my new lecturer in uni only reads his notes to us without teaching us to physically write the code.
any help is much appreciated.
prompt = 'shapes (circle, rectangle, cylinder):';
shapes = input(prompt,'s');
if shapes =='circle'
prompt = 'input r:';
elseif shapes =='rectangle'
prompt = 'enter (length:)';
prompt= 'enter (breadth:)';
formatspec= 'value in squared units %10.3f';