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

조회 수: 2 (최근 30일)
Bran
Bran 2013년 8월 7일
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 :(

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 7일
편집: Azzi Abdelmalek 2013년 8월 7일
x=load('current1.mat');
MAT=x.current1
If you want to know the variables names in your file
whos('-file','current1.mat')
  댓글 수: 5
Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 7일
That means, your variable name is current (not current1). Type
x=load('current1.mat');
MAT=x.current
Bran
Bran 2013년 8월 7일
Thank you! It works fine now! :D

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by