Simulink Block IO signal data type reference inside the fcn block
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Dear experts,
Just wondering if it is possible to reference I/O data type specified in "Edit Data" inside a fcn block, while doing value assignment.
For example, input "u" is defined as "fixdt(1,9,0)" in "Ports and Data Manager". Currently I have to do this explicitly: "u = fi(3, 1, 9, 0)" if I wanna say "u=3".
I am thinking it will be convenient if I could just do "u = fi(3, numerictype(u))".
Thanks,
7 commentaires
Kaustubha Govind
le 26 Fév 2013
Using "u = fi(3, numerictype(u))" works for me. Are you seeing an error?
legendbb
le 26 Fév 2013
legendbb
le 28 Fév 2013
Kaustubha Govind
le 28 Fév 2013
legendbb: It works for me both when the input type is set to "Inherit" or when it is explicitly specified. What error do you get in the second case?
legendbb
le 1 Mar 2013
Kaustubha Govind
le 4 Mar 2013
"Error: Undefined function or variable 'u'. The first assignment to a local variable determines its class." - this means that "u" is not defined as ta local/input variable in the function. I assumed "u" was your input because you posted the 'u=fi(3,numerictype(u))' line originally as a desirable syntax.
legendbb
le 4 Mar 2013
Réponses (0)
Cette question est clôturée.
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!