save matrix....load matrix

조회 수: 323 (최근 30일)
Andrew
Andrew 2014년 1월 28일
댓글: Andrew 2014년 1월 28일
A =
2 3 4
5 6 7
8 8 9
how can i save the matrix A to a file (txt or mat)? And then load it and have
C=...something...
and in matlab it will appear
C =
2 3 4
5 6 7
8 8 9
thank you...

채택된 답변

Amit
Amit 2014년 1월 28일
You can save the variable as a mat file using something like this:
save('saveA.mat','A');
To do the second step, you can create a matfile object like;
example = matfile('saveA.mat');
C = example.A;
  댓글 수: 1
Andrew
Andrew 2014년 1월 28일
thank you!

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

추가 답변 (1개)

Mischa Kim
Mischa Kim 2014년 1월 28일
편집: Mischa Kim 2014년 1월 28일
Use
save('A.mat','A')
and the corresponding load.
  댓글 수: 1
Andrew
Andrew 2014년 1월 28일
thank you!

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by