How can I import the value of the Matlab simulink to the default workspace?

2 visualizaciones (últimos 30 días)
How can I import the value of the Matlab simullink to the basic workspace?

Respuestas (1)

Angelo Yeo
Angelo Yeo el 18 de Abr. de 2025
To export values in different workspace to base workspace, you can use assignin. An example is below.
function foo
n = 123;
assignin('base','baseWorkSpaceVar',n);
end
As a result, a variable called "baseWorkSpaceVar" will be saved in your base workspace with the same value as "n" in the function "foo".

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by