How can I save a variable from the workspace to use it for another script?
조회 수: 43 (최근 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!