Run different calculation for each value chosen from the listbox

2 次查看(过去 30 天)
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)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by