-2

working with MATLAB, I have a Matrix M, I want to save it in a .mat file then import it and reuse it in my code. I have tried:

save ('file1.mat','M')
MSaved=load('file1.mat');

Name   | Size    | Bytes | Class  | Attributes
-------+---------+-------+--------+-----------
MSaved | 4215x20 | 40744 | double |

How can I get access to each cell of the matrix? How to save it again in a matrix?

Need some help, thanks in advance.

esote
  • 831
  • 12
  • 25
user3967257
  • 69
  • 1
  • 5

1 Answers1

0

The load function will return a structure containing all the saved variables. So your matrix is MSaved.M

oro777
  • 1,110
  • 1
  • 14
  • 29
  • >> save example.mat M -v7.3; >> MSaved = matfile('example.mat') ; >> firstColB = MSaved.M(:,1); >> EE=Msaved.M(:,:); This is what I found as a solution, yes it is the same MSaved.M – user3967257 Nov 22 '16 at 02:41