GUI Edit Boxes and recalling values.
1 次查看(过去 30 天)
显示 更早的评论
Hi there,
I have just started to make a GUI for a Shooting method projectile problem.
I have 2 input angles and a error specified by the user. I have 3 edit boxes where I input the data for the three values (theta1, theta2, reqe). Please see code below.
function theta2_Callback(hObject, eventdata, handles)
% hObject handle to theta2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of theta2 as text
% str2double(get(hObject,'String')) returns contents of theta2 as a double
theta2 = str2double(get(hObject,'string'));
if isnan(theta2)
errordlg('You must enter a numeric value','Bad Input','modal')
uicontrol(hObject)
return
end
same thing for theta 1 and reqe.
Then I have a push button where I want to run my function file called 'Shooter'
But I can't seem to do it. Also i cannot carry forward the variables from the previous functions. The Shooter function needs all 3 values to run.
Shooter(theta1, theta2, reqe);
This m file then calculates everything I need.
Many thanks.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Oceanography and Hydrology 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!