Simulink matlab function , import data from the workspace
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to import data in position to simulink matlab function which is updating.
If I type "position.data" on command window, it shows the value.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1108875/image.png)
How should l import it?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1108880/image.png)
this is obviously not working.
Can you also tell me how I can import the value in the case of updating position.data value?
Thanks
0 Commenti
Risposte (1)
Prasanna Konyala
il 29 Ago 2022
From my understanding you are trying to use base workspace variable “position” in the function.
Function workspace is different from base workspace. We can’t access base workspace variables in function. To access base variable in function we need to make the variable global. Making variable global allows it to be used in all the function definitions.
Please refer to the following document capturing more information on how to access base workspace variable in function workspace:
Hope this helps!
0 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!