[問題] 在GUI- 要怎宣告sin cos ..等的含式已回收
function anspushbutton_Callback(hObject, eventdata, handles)
% hObject handle to anspushbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
v0=get(handles.inv,'String');
ih=get(handles.inl,'String');
ang=get(handles.ina,'String');
ti=get(handles.inti,'String');
g=9.8;
tt=v0*sin(ang)/g; % time to reach the max height
^^^^^^^^
??? 如何宣告!?
==========================================================
在pushbutton下宣告一些運算式 即 按下button 他會將輸入的input作些運算
??? Undefined function or method 'sin' for input arguments of type 'char'.
Error in ==> l9>anspushbutton_Callback at 200
tt=v0*sin(ang)/g; % time to reach the max height
試過用char
"There is no 'char' property in the 'uicontrol' class."
要如何解!! 感覺好亂阿!! 請幫忙一下...
感謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.169.209.180
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章