필터 지우기
필터 지우기

how to load .mat file into a function

조회 수: 48 (최근 30일)
Vittoria D'Avino
Vittoria D'Avino 2014년 3월 13일
댓글: SRI 2014년 3월 14일
Hi,
I need your help if possible. I've recently started to learn matlab! I need to load a .mat file (a matrix of 57x9) as input of my function. Can you say me how to write this in the code of the function?
thanks for your time
Vittoria
  댓글 수: 2
SRI
SRI 2014년 3월 14일
편집: SRI 2014년 3월 14일
function Exchange = Input(A)
A = magic(8);
save mydata.mat A
load mydata.mat
disp(A)
SRI
SRI 2014년 3월 14일
just try this out in two script one as function file next as main file

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

답변 (2개)

Marta Salas
Marta Salas 2014년 3월 13일
function myfunction(myMat)
load(myMat);
%your code
you call your function as: myfunction('path/MyMat.mat')

Suneesh
Suneesh 2014년 3월 13일

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by