Why my simulink model is running in R2018b but not in R2015a ?

2 ビュー (過去 30 日間)
elie solai
elie solai 2019 年 2 月 13 日
コメント済み: elie solai 2019 年 2 月 15 日
Hi all,
I am using a Simulink Model originally developped under Matlab R2018a. The model is composed mostly of matlab functions blocks are more basic blocks. There is no other specific module needed than the ones included in Simulink.
The model runs fine in my R2018b matlab version.
But i have to make it run in Matlab R2015a version, because it's the only matlab version installed on the cluster i work on.
So I just Exported the model to previous version as it is suggested by matlab.
I got erros like "Undefined function or variable <my_variable>. The first assignment to a local variable determines its class"
This error occurs for only 2 variables in the whole model. These two act both as input and output for some functions. I attached a screenshot of the errors displayed by Simulink. SimulinkErrors_plafrim.png
I am struggling with this issue because my model works perfectly on my local machine (where i have R2018b installed).
Do you think this might be only a version problem or a deeper error may have occured ?
Thank you for any help or tips on this issue
I wish you a very good day.
Cheers,
Elie
  2 件のコメント
Yasasvi Harish Kumar
Yasasvi Harish Kumar 2019 年 2 月 14 日
Hey,
Can you attach the model that you are working on?
Regards
elie solai
elie solai 2019 年 2 月 14 日
Hi ,
unfortunately it's for an industrial application, so I am not allowed to show the model.
But, these two variables are in input and output of a function.
Like this :
[...,m_dot_liq,...] = function(...,m_dot_liq,...)
The function is inside a time loop. So i guess there is a problem with the initialization of the variables at the beginning and then the model can't run.
The thing that really bothers me is that the model is perfectly running in R2018b. I just exported it to R2015a. Do you think this operation could have a bigger impact than just making a copy of the model ?
Thanks again for your help !
cheers
Elie

サインインしてコメントする。

採用された回答

Yogananda Jeppu
Yogananda Jeppu 2019 年 2 月 15 日
Do you use variable being passed inside as an array. The matlab function in the simulink may require the array size to be defined. I normally assign zeros(10,1) to value x and then assign x to the input variable. x is used inside later. This defines the array of length 10x1. if your function code is big and you use m_dot_air in the code. then pass the variable as m_dot_air1 as a paremeter. function(...,m_dot_air1,...). Inside the function say m_dot_air = zeros(10,1); m_dot_air = mdot_air1;
  1 件のコメント
elie solai
elie solai 2019 年 2 月 15 日
Thanks very much for this ! It was not exactly the solution, but definitely a very good work around and I fixed the problem.
Thanks again
cheers
Elie

サインインしてコメントする。

その他の回答 (2 件)

qrqr
qrqr 2019 年 2 月 14 日
2018で作ったから2015では対応できないのでは?
2018に新しくできたブロックを使っていたら2015では当然できませんよね。
  3 件のコメント
elie solai
elie solai 2019 年 2 月 14 日
Ok thanks for this tip. But the block where the error occurs is just a simply matlab function block.
Do you think that some other block in the model, an only 2018 version one, could provoke this error in the classic matlab function blocks ?
qrqr
qrqr 2019 年 2 月 14 日
That's what I think

サインインしてコメントする。


Yogananda Jeppu
Yogananda Jeppu 2019 年 2 月 15 日
You can try the Signal Specification block from Simulink >> Signal Attributes >>. Perhaps this will work. Enable data type and signal dimension display. Format >> Port/Dsiplay >> Signal Dimensions. If you see any ? marks then that needs to be sorted out.

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by