[問題] 在GUI- 要怎宣告sin cos ..等的含式已回收

看板MATLAB作者 (kelune)時間17年前 (2008/12/11 22:30), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
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
文章代碼(AID): #19GIG73K (MATLAB)
文章代碼(AID): #19GIG73K (MATLAB)