Can't assign a string value from mask to an input of MATLAB function block in Simulink

2 vues (au cours des 30 derniers jours)
Greetings,
My MATLAB function block has bus signals created from Bus Creators for inputs. The MATLAB function block is suited for calculating values from certain attributes contained in aforementioned bus signals. I would like to create a mask for the MATLAB function block and declare a parameter, in which i would state the names for the attributes that should be used in calculations. So the parameter should be a string value that is sent to the function block.
I've set up an additional input for the function block with the same name as the parameter in mask, changed its scope to "Parameter" and Data Type to "string" in the Model Explorer, checked off the "Tunable" and "Evaluate" flags both in Model Explorer and in Mask Editor. At the end, during the compilation stage i got an error "Expression 'testvar' for initial value of data 'testvar' must evaluate to specified type string."
I haven't faced any problems propagating in a likewise way a numeral parameter (setting up inherited data type, providing a number in the mask field and alowing evaluation), but it seems that there is no way to send a string from the mask to function block code. Any suggestions how to solve this problem or evade it?

Réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by