Save a matrix in MATLAB

278 ビュー (過去 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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by