How can I save a variable from the workspace to use it for another script?
31 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
HelpAStudent
el 2 de Oct. de 2021
Comentada: Stephen23
el 2 de Oct. de 2021
Hi, I want to save this variable for use that (and other one) in a brand new script
1 comentario
Stephen23
el 2 de Oct. de 2021
By far the best approach is to use functions (not scripts) and pass the data as input/output arguments:
Respuesta aceptada
DGM
el 2 de Oct. de 2021
You can save variables to a .mat file and then load the .mat file in the other script.
In practice, it's a good idea to load into a struct and explicitly define the incoming variable:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!