How can I solve dimension problem? Simulink

4 次查看(过去 30 天)
Hello everyone,
I am getting this error
" Error in port widths or dimensions. 'Output Port 1' of 'untitled/From29' is a one dimensional vector with 1369 elements."
saveV.mat size 1370x2 [time,Velocity]
saveACC.mat size 1370x2 [time,Acceleration]
both like,
0 3
1 5.9
2 4
. .
. .
. .
Also I do not know why size decreased from 1370 to 1369.
Thank you...
  2 个评论
Walter Roberson
Walter Roberson 2022-5-26
Sample Time is not number of samples! It is related to the rate at which the block is considered to output samples.
Hasan Atacan Tosun
Hasan Atacan Tosun 2022-5-26
I changed it to 1 and then -1 still the same error

请先登录,再进行评论。

采纳的回答

stozaki
stozaki 2022-5-27
The Logical operands input of the If block must be a scalar signal. It's a block specification.
Also, the output of the If block should be connected to the Action Subsystem. It is also a block specification.

更多回答(1 个)

Walter Roberson
Walter Roberson 2022-5-27
You need to transpose the data in the file. The first row is the time stamps and rows after that are samples for that time. You have two times and 1369 values.
This is unlike From Spreadsheet, which treats the first column as time if I recall correctly.

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by