0

i'm trying to load part of array in a matfile like is showed in http://www.mathworks.com/help/matlab/ref/matfile.html

however, when i use loadedData = matObj.varName(indices) i keep getting: 'varName' does not exist

someone knows what's rong?

Shai
  • 111,146
  • 38
  • 238
  • 371
Findios
  • 307
  • 1
  • 4
  • 14

1 Answers1

0

In place of VarName you should use the name of the actual variable you want to retrieve.

Suppose you have saved a variable A into myMat:

A      = rand(10);
save('myMat','A','-v7.3')

matObj = matfile('myMat');
data   = matObj.A(1:2,2);
Oleg
  • 10,406
  • 3
  • 29
  • 57