How to Import Data from another MATLAB file?

조회 수: 27 (최근 30일)
Tom
Tom 2019년 7월 28일
댓글: Star Strider 2019년 7월 28일
I have a MATLAB file which creates a 400x1 array when I run it, I would basically like to copy the data from that array over into a new MATLAB file, so when I start the new file I would like to load that vector into the new file so that I can use it in equations. What would be the easiest way of doing this?

채택된 답변

Star Strider
Star Strider 2019년 7월 28일
I would save it as a .mat file in the first .m file, then load it into the new .m file.
  댓글 수: 2
Tom
Tom 2019년 7월 28일
편집: Tom 2019년 7월 28일
The vector is called F, I tried save F.mat to then load it in the new .m file, but it seems to save everything in the workspace created by the first file, rather than just saving that one vector alone.
Edit: Not to worry, I've done it now.
Star Strider
Star Strider 2019년 7월 28일
Great!

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

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by