【发布时间】:2015-01-18 02:19:45
【问题描述】:
我有一个MATLAB GUI,它为用户提供了勾选选项。每个刻度都有不同的数学意义。用户勾选某些内容后,计算将在他们按下“计算”后完成。
我在“计算”按钮下的主要公式是:
effective_weight = weight + pilotsw + fo_weight %pilots weight & first officer's weight
pilots_weight & fo_weight 有不同的复选框,它们的代码如下:
function checkbox2_Callback(hObject, eventdata, handles)
% hObject handle to checkbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox2
% --- Executes on button press in checkbox3.
if (get(hObject,'Value') == get(hObject,'Max'))
pilotw = -100
else
pilotw = 0
end
全球飞行员(和副驾驶的复选框相同)
并且 Pilotw 是计算函数的全局变量。
目标是改变有效重量,并在飞行员在场(或不在场)时进行相应的计算。
【问题讨论】:
-
您的问题/疑问究竟是什么?
标签: matlab user-interface checkbox global