【问题标题】:Real time update of GUI GraphGUI Graph的实时更新
【发布时间】:2015-10-05 15:31:01
【问题描述】:

我已经制作了一个 simulink 模型,并通过 MATLAB GUI 运行它,该 GUI 包含一个 BLDC 电机和一个控制其速度的 PI 控制器,现在的问题是当我停止我想要更新的模拟时输出速度图会更新它自己在运行时

% Update the string on the pushbutton
set(handles.Startstopbutton,'String','Start Simulation')

% Plot results from workspace after simulation
x = evalin('base','Scope(:,1)');
y = evalin('base','Scope(:,2)');
pHandles = plot(x,y,'Parent',handles.axesplot); 

这就是我的图表更新功能

【问题讨论】:

    标签: matlab simulink matlab-guide


    【解决方案1】:

    有多种方法可以让 MATLAB UI 在 Simulink 模型运行时与其交互,包括

    1. 在每个时间步使用自定义 S-Function 将数据传递给 UI

    2. 使用设置的事件监听器来监听块(信号)的变化。

    Use MATLAB GUI's with Simulink Models 博客更详细地讨论了这些方法。

    【讨论】:

      猜你喜欢
      • 2015-09-17
      • 2023-04-02
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多