簡體   English   中英

Matlab 腳本:顯示我的 Simulink 模型的輸出

[英]Matlab script: Display the outputs of my Simulink model

我有以下 Simulink 模型: 在此處輸入圖片說明

我有以下腳本:

Constant=43;
Constant1=43;
Constant2=43;
Constant3=43;
Constant4=43;
Constant5=43;
Constant6=43;
Constant7=43;
Constant10=43;
Constant11=43;
In1=[1,2,3];
In2=[4,5,6];
t_stop = 10;
T_s = t_stop/1000;
options = simset('solver', 'ode5', 'fixedstep', T_s);
sim('test_lau.slx',t_stop,options)

我想顯示並最終調用輸出 Display、Display2 和 Display3。

我嘗試將最后一行更改為:

[Display, Display2, Display3]=sim('test_lau.slx',t_stop,options)

但得到錯誤:

Number of left-hand side arguments doesn't match block diagram. When specifying that root-level outports are to be returned individually, the number of left-hand side arguments must be 2 (for T,X) plus number of root-level outport blocks

有誰知道如何從腳本中提取這些輸出?

預先感謝您的幫助!

感謝@Ander Biguri 和@Wolfie 答案是使用塊“to Workpace”而不是塊“Display”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM