How to store an object (calculated in a function) so that we can use it later with a different script?

조회 수: 1 (최근 30일)
So basically I have a script that calculates a lot of stuff, and in the process it creates an object that is not stored/saved in the command window's workspace. I have no way to use it unless I add code to the existing scripts.
I would like to feed that object to another script.
How can I store/save this object so that I can re-use it in the future?

채택된 답변

Gareth Thomas
Gareth Thomas 2014년 7월 7일
Typically people use MAT files for this.
a = rand(10);
b = rand(12);
save myMat a b
clear all
load myMat
Hope that this helps
Here is official example off their website
  댓글 수: 3
Gareth Thomas
Gareth Thomas 2014년 7월 7일
If you have the class definition in the path then it will work, if I am not mistaken.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by