MATLAB Function Interface Error
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a MATLAB function block that has two inputs and one output. One input is a column vector with values for calculations and is a variable size. The other input is a bus signal with a fixed size. The output is another column vector that is a variable size. I have checked all the ports (both in the model explorer and the ports and data manager, which I think should show the same thing as far as the ports go) on the input blocks, the function block, and the output block. From what I can tell they all are set to the proper mode (i.e. variable or fixed) but I am still getting the following error:
MATLAB Function Interface Error: Unable to propagate the variable-size mode from the input 'SimulinkReactor' of 'SimulinkReactor'. This input expects a fixed-size mode. The variable-size mode originates from 'SimulinkMATLAB Function Block/MATLAB Function Block/ SFunction '. Examine the configurations of 'MATLAB Function Block' for one of the following scenarios: 1. The block does not support variable-size signals 2. The block supports variable-size signals but needs to be configured for them. You can enable variable-sizing for 'MATLAB Function Block' from the ports and data manager dialog.
Any ideas what I could be missing?
0 comentarios
Respuestas (2)
Kaustubha Govind
el 9 de Nov. de 2011
It looks like the error is about the output of the MATLAB Function block. Have you configured it as a variable-size signal and specified the maximum dimensions correctly? See this page for an example. It looks like you also need to use the coder.varsize directive to specify that the output is of variable-size.
7 comentarios
Kaustubha Govind
el 21 de Nov. de 2011
There is no way to convert a variable-size signal to a fixed-size signal, because that doesn't make sense - how would you convert a signal that varies size during simulation to one that doesn't? Perhaps you should rewrite your MATLAB Function block code to emit fixed-size signals if that's what makes sense for your application. You can always use the maximum size at all times, and fill in the invalid elements with zero (or some invalid value) if you really want to simulate a variable-size signal.
imran Hossain
el 5 de Feb. de 2012
i have same problem with the interface error in simulink block. i create the 16-apsk modulation and demodulation block using matlab code. when i run this individual block there is no error but when i put this block other existing 16-qam or psk it shows "MATLAB Function Interface Error: Simulation stopped due to out of bounds error. Block MATLAB Function1 (#19) While executing: none ". anybody if have some idea or logic, i would like to request please share with necessary information.
1 comentario
Shubham Kapoor
el 15 de Abr. de 2015
did u sort the problem out?I have to write the apsk modulation code and demodulation code too.Can you help in writing the code for modulation and demodualtion
Ver también
Categorías
Más información sobre Test Model Components en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!