How to use workspace variables in simulink's matlab function?
Mostrar comentarios más antiguos
I have a structure in workspace and intend to use its variables several times in simulink function. Creating a constant block with the "par" (name of my structure in workspace) and then passing it as an input in the function block is giving me errors.
2 comentarios
Raj
el 13 de Mayo de 2019
Without any data, it is difficult to guess how exactly you are trying to pass the data, how you are trying to use the data in your function block and why you are getting an error. If possible share your workspace data mat file and model.
Smit Saparia
el 13 de Mayo de 2019
Respuestas (1)
Sulaymon Eshkabilov
el 13 de Mayo de 2019
0 votos
Hi,
Here is a quick and easy solution. A small trick to make MATLAB Fcn block of Simulink to accept the data from the structure type of variable value (s) from the MATLAB workspace.
Good luck.
2 comentarios
Smit Saparia
el 14 de Mayo de 2019
Sulaymon Eshkabilov
el 14 de Mayo de 2019
Hi,
Use the right mouse button option - and click - Save link as ... that downloads the file (SIM_main.slx) into your computer.
Good luck.
Categorías
Más información sobre Sources en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!