Run with command line but not with simulink

Hi,
I have a function that works well in command line. I integrate it into a simulink and it's not working.
Errors are like :
  • Mixed field types in structure arrays are not supported
  • FIND requires variable sizing
Any recommendation ?
NB:I am using Matlab 2017b

8 件のコメント

Bob Thompson
Bob Thompson 2019 年 2 月 11 日
編集済み: Bob Thompson 2019 年 2 月 11 日
What is the command that you are trying to use? Please include more information about your code.
Mohamad TOUT
Mohamad TOUT 2019 年 2 月 12 日
編集済み: Mohamad TOUT 2019 年 2 月 12 日
Hi,
I have a funciton with several inputs that works. This function include a load of a .mat which is a structure file.
I added this function to a MATLAB function in simulink but first it gave these errors :
  • Mixed field types in structure arrays are not supported : it came from the load of .mat ! ( i don't know why because for me, it's working when i run it alone) .
  • FIND requires variable sizing : i found that when using the function (another one) in simulink, it's not accepting my code with the Find funciton. So, i made my changes and it's OK now.
  • Finally, i tried to use the S-function inside the simulink instead of MATLAB function and i get the error of Not enough input arguments.
Thank you in advance but i really don't know why using the function into simulink is not working where it works alone ?!
Jan
Jan 2019 年 2 月 12 日
What is a "structure file"? How do you "add a function"?
Maybe the problem gets clear, if you post a minimal working example, which reproduces the problem.
Mohamad TOUT
Mohamad TOUT 2019 年 2 月 12 日
Sorry for this unclear question,
i attached an example.
the function 'test_test.m' works well but inside the test.slx it is not working.
the error is :
Mohamad TOUT
Mohamad TOUT 2019 年 2 月 13 日
Any idea ??
Jim Riggs
Jim Riggs 2019 年 2 月 13 日
編集済み: Jim Riggs 2019 年 2 月 13 日
I am just guessing based on the text of the error, but it seems that Simulink has a problem loading the file 'test1.mat' because there are different field types.
it also says "use the command 'whos -file test1,mat' to view the variables in the MAT file'
Did you do this? What is the result?
Mohamad TOUT
Mohamad TOUT 2019 年 2 月 13 日
yes i tried this but i don’t have different types in ‘test1.mat’ !
the function ‘test_test‘ uses the file test1 without any problem but when using the same function ‘test_test‘ inside simulink, it gives the above error !
Mohamad TOUT
Mohamad TOUT 2019 年 2 月 14 日
Please Help :)

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

回答 (0 件)

カテゴリ

質問済み:

2019 年 2 月 11 日

コメント済み:

2019 年 2 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by