Hello, i have this hw question for my lab(matlab),
i did most of it, but idk why it shows error when i run it, and idk how to insert the sentence at the beginning (please select one...),
i would really be grateful if you solved it for me, and i would much appreciate it more if you explain where i went wrong and what did i miss.
Thank you
Lab Exercise: 1-Write a script that shows the user the following menu: . If the user selects the button (x), the script should print an error message. MATLAB Programming - En Isha Alkandari . If the user selects the button (Area): The script should 1. Ask the user to enter the radius 2- Call the function (getarea) which calculates the area of the circle then calls its subfunction (printarea) to print the result. If the user selects the button (Circum): The script should: 1- Ask the user to enter the radius 2- Call the function (getcircum) which calculates the circumference of the circle then calls its subfunction (printcircum) to print the result. of the user selects the button (Exit), the program stops There should be one script and two functions (with a subfunction for each) to calculate and print the result Command Window Plesse select one option from the menu LEO Please select one option from the menu Enter the raduis: 5 Area of circle - 78.54 Area Cro Please select one option from the menu Enter the raduis! 5 Circumference of circle - 31.12 Please select one option from the menu + WNA 1 menu.m 30 getarea.m getcircum.m 1 2 - mypick = menu('Calculate', 'Area', 'Circum', 'Exit'); 3- Qwhile(true) 4 if (mypick==1) 5 radius = input('Enter radious: '); 6 getarea(radius); 7 pick=menu('Calculate', 'Area', 'Circum', 'Exit'); 8 9 10 elseif(mypick==2) 11 radius = input('Enter radious: '); 12 getcircum(radius); 13 pick=menu('Calculate', 'Area', 'Circum', 'Exit'); 14 15 16 elseif (mypick==3) 17 break 18 19 else 20 disp('Error'); end 22 end 21 22 Command Window >> menu Attempt to execute SCRIPT menu as a function: /Users/afrah/Documents/MATLAB/200LAB/menu.m Error in menu (line 2) mypick menu('Calculate', 'Area', 'Circum', 'Exit'); menu.mx getarea.mx getcircum.mx + 1 function getarea (radius) 2- area = pi * radius^2; 3 - printarea(area); 4- end 5 6 function printarea(area) 7- fprintf('Area of circle = %f', area) 8- end menu.m 1 2 3 4 5 6 7 8 getarea.mx getcircum.mx + e function getcircum(radius) circum = 2 * pi * radius; printcircum(circum); end e function printcircum(circum) fprintf('Circumfrence of circle : %.2f',circum) end