Error While Propagating Size

20 次查看(过去 30 天)
I have made a Matlab function called ESC in a Simulink file. My input is a 4x1 vector and my output should also be a 4x1 vector. I get the following error:
Propagated size of data [output variable name] changed when propagating type. The size was fixed to be 'scalar' and now became '[4]'.
Specify the type of all inputs to avoid this error. Or, fully specify all inherited properties of your outputs.
I never specified that the output had to be a scalar... how do I fix this? I've never run into this problem before despite having very similar function blocks in Simulink files and I'm not sure what makes this case different.
Thanks in advance!
-JP

采纳的回答

Madhu Govindarajan
Madhu Govindarajan 2015-10-16
Have you tried editing the size of output in the edit data portion of MATLAB function?
1) Open the MATLAB function in MATLAB Editor 2) Click on the Edit Data tab in the top right next to the build model icon 3) In the Ports and Data manager tab that opens up edit the output variable's size to match what you need it to be or try making it variable size.
If this does not help, sharing files that reproduce your error will be of help

更多回答(1 个)

jose luis huayanay villar
El tamaño propagado de los datos 'D' cambió durante la propagación. El tamaño fue arreglado para ser 'escalar' y ahora se convirtió en '[1 3]'. Especifique el tamaño de todas las entradas para evitar este error. O bien, especifique completamente todas las propiedades heredadas de sus resultados.

类别

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by