Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Matlab help Show me matlab code Using the two functions you wrote in the last ho

ID: 672166 • Letter: M

Question

Matlab help

Show me matlab code

Using the two functions you wrote in the last homework (just assume function1 and function2), write a small script that when run, presents a menu (i.e. use the function "menu") to bring up a GUI allowing you to choose which of the two routines (runBMI or the heart rate function), then create a if-else-end statement that actually runs the appropriate script. Title the menu "Health Calculations".

Run the script twice (you don’t need a screen capture of the GUI), showing that each script is appropriately called. If your functions from last homework didn’t work, you can simply put disp statements in their place that indicate this is where the function call should occur - or contact me and I'll get you functions to use.

Explanation / Answer

function 1:

fig = figure('Main Menu Health Caluclulations', 'None');

mb = uimenu(fig, 'Label', 'runBMI' , 'Callback', disp(''BMI'')');

uimenu(fig, 'Lable', 'heartRateFunction', 'Callback', disp(''heartRateFunc'')');

function 2:

if (menu == runBMI) then runBMI

else heartRateFunction