MATLAB Answers

How to Import Data from another MATLAB file?

68 views (last 30 days)
Tom on 28 Jul 2019
Commented: Star Strider on 28 Jul 2019
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?


Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 28 Jul 2019
I would save it as a .mat file in the first .m file, then load it into the new .m file.


Tom on 28 Jul 2019
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.

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by