How can I save a variable from the workspace to use it for another script?
44 次查看(过去 30 天)
显示 更早的评论
Hi, I want to save this variable for use that (and other one) in a brand new script
1 个评论
Stephen23
2021-10-2
By far the best approach is to use functions (not scripts) and pass the data as input/output arguments:
采纳的回答
DGM
2021-10-2
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!