from File and if block conditions error

1 次查看(过去 30 天)
Hello everyone,
I am building a Simulink structure for my homework which is about EVs.
I have Drive_cycle.mat contains time and corresponding speeds. It is directly connected (used goto, from blocks) to if block.
But I am getting an error. And I could not solve it.
I really appreciate any help you can provide. Thank you
  2 个评论
Harshit Rastogi
Harshit Rastogi 2022-5-25
Hi Hasan, If possible could you please share the model and drive cycle data here. I think that you are giving the drive cycle as input to the 'if' block. As drive cycle has 2 columns , 'if' block is not able to know with whom to compare the given value. Also instead of goto and from block , first open the subsystem and try connecting the drive cycle directly to the if block.
Hasan Atacan Tosun
Hasan Atacan Tosun 2022-5-26
CYC.mat size 1370x2 [time,Velocity]
like,
0 3
1 5.9
2 4
3 9
. .
. .

请先登录,再进行评论。

采纳的回答

Hasan Atacan Tosun
Hasan Atacan Tosun 2022-5-28
If block specification. the output of the If block should be connected to the Action Subsystem.
  1 个评论
Walter Roberson
Walter Roberson 2022-5-28
This does not explain the error about the port dimensions, or why 1369 instead of 1370.
Real problem is that your data must be 2 x 1370 instead of 1370 x 2

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2022-5-27
Transpose your mat data. Timestamps are first row not first column.

类别

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