Save a matrix in MATLAB

조회 수: 269 (최근 30일)
rihab
rihab 2015년 11월 4일
댓글: Adam 2018년 6월 25일
I have a 100x100 matrix in MATLAB and I want to save it in matlab format. Is there a way to do so in MATLAB?

채택된 답변

Adam
Adam 2015년 11월 4일
편집: Adam 2018년 6월 25일
save( filename, 'matrixName' )
e.g.
myMatrix = rand( 100, 100 );
filename = 'C:\Stuff\Somefile.mat';
save( filename, 'myMatrix' );
Be sure to use the .mat extension for your file.
  댓글 수: 6
Luthando Maqondo
Luthando Maqondo 2018년 6월 24일
This does not save the Matrix as it is, it stored a struct version of if and now I can't index the elements in side the matrices. Even the size(Matrix) function gives a 1x1 for a matrix expected to be 4 dimentional;
Adam
Adam 2018년 6월 25일
It works fine for me. I get the same matrix in file as I do in my workspace.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by