Run different calculation for each value chosen from the listbox

1 view (last 30 days)
Calculation script
global popVal
cg=(0.2*popVal)./(std(Bf)*6);
cgk=(0.1*popVal-sqrt(((Betaavg-Refx).*(Betaavg-Refx))))./(3*std(Bf));
MASTER{15,MASTERcount}=cg;
MASTER{16,MASTERcount}=cgk;
How do I store different values on to my handle everytime I choose an answer from my listbox?
Matlab gui
function popupmenu13_Callback(hObject, eventdata, handles)
contents = cellstr(get(hObject,'String'));
popChoice= contents(get(hObject,'Value'));
assignin('base','popChoice',popChoice)
global popVal
if (strcmp(popChoice,'Select Beta Tolerance'))
popVal=0;
elseif (strcmp(popChoice,'5°'))
popVal=5;
elseif (strcmp(popChoice,'6°'))
popVal=6;
elseif (strcmp(popChoice,'7°'))
popVal=7;
elseif (strcmp(popChoice,'8°'))
popVal=8;
elseif (strcmp(popChoice,'9°'))
popVal=9;
elseif (strcmp(popChoice,'10°'))
popVal=10;
end
assignin('base','popVal',popVal)

Answers (0)

Categories

Find more on Simulink Environment Customization in Help Center and File Exchange

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!