Run different calculation for each value chosen from the listbox
1 次查看(过去 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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Environment Customization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!