Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 其它 > 资料存档
资料存档 资料存档
回复
 
主题工具 显示模式
旧 2019-12-02, 11:00   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
默认 我在从GUI执行simulink时遇到问题,谁知道这是怎么回事?

我试图从GUI的编辑文本中绘制“ t vs y”设置的一些值,其中之一以“ tfinal”作为“停止时间”,但是当我运行代码时,它不会替换它,并在出现以下错误时显示尝试更换它:(*希望您能帮助我)

Error evaluating expression 'tfinal' for 'StopTime' specified in the Configuration Parameters dialog for block diagram 'gui_sim_model'. . . . Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)gui_adv_sim('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) - Show complete stack trace Caused by: Error using gui_adv_sim>pushbutton1_Callback (line 184) Unrecognized function or variable 'tfinal'. - Showcomplete stack trace Error using gui_adv_sim>pushbutton1_Callback (line 184) Variable 'tfinal' has been deleted from base workspace. Gui中的代码(按钮):

function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global tfinal vfinal abty tfinal = str2double(get(handles.tf,'String')); vfinal = str2double(get(handles.vf,'String')); a = str2double(get(handles.aval,'String')); b = str2double(get(handles.bval,'String')); sim('gui_sim_model'); axes(handles.axes1) plot(t,y) xlabel('time in seconds') ylabel('value of y') Simulink: https//i.stack.imgur.com/IchLG.png

界面: https//i.stack.imgur.com/T08lf.png



更多&回答...
poster 当前离线   回复时引用此帖
回复

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛禁用 表情符号
论坛启用 [IMG] 代码
论坛启用 HTML 代码



所有时间均为北京时间。现在的时间是 03:24


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.