'load' command - loading and using data from a .MAT file

3 views (last 30 days)
Hi there I would like to load data from a .mat file but retain it's structure. It is a 17x17x17 matrix and at the moment I am simply using the following
load current1.mat
MAT = current1
But there seems to be a problem and I am told there is no such thing as current1 where am I going wrong. Also I need to be careful because some of the commands for loading and using data turn it into a 1x1 array??
I'm quite confused :(

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 7 Aug 2013
Edited: Azzi Abdelmalek on 7 Aug 2013
x=load('current1.mat');
MAT=x.current1
If you want to know the variables names in your file
whos('-file','current1.mat')
  5 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 7 Aug 2013
That means, your variable name is current (not current1). Type
x=load('current1.mat');
MAT=x.current

Sign in to comment.

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!