フィルターのクリア

Creating matrixes in .mat file

1 回表示 (過去 30 日間)
Victor
Victor 2014 年 6 月 25 日
コメント済み: Victor 2014 年 6 月 25 日
I want to create a .mat file and inside the .mat file, there are variables that represent individual matrices. So lets say in the .mat file I have a, b, c, d. And each a, b, c, d has its own matrix and I can add contents into each matrix. Is there a way to do this? thanks
  1 件のコメント
José-Luis
José-Luis 2014 年 6 月 25 日
編集済み: José-Luis 2014 年 6 月 25 日
You can place as many individual elements in a .mat file as memory permits. Those can be scalars, structures, cell arrays, tables, etc...
Please read the documentation on save to see how to put several variables in a .mat file.
doc save

サインインしてコメントする。

採用された回答

Sandip More
Sandip More 2014 年 6 月 25 日
Yeah Victor. It can be done easily. Please specify matrix a b c and d and then simply create matrix whose elements are a b c d. It works. try it out.

その他の回答 (1 件)

Victor
Victor 2014 年 6 月 25 日
What if i have a function where i want to create new variables inside that .mat file? So in the function i want to create a variable c as a matrix and append it to the .mat file.
  3 件のコメント
Victor
Victor 2014 年 6 月 25 日
Sorry about posting my comment in the wrong area. And well what I want to do is this:
I have a separate script that will create a .mat file, let's call it test.mat. I want to create a function that will add a variable matrix inside the .mat file. The function will have input arguments such as: func(a,b,c,d). So every time I run this function, whatever I put in the input arguments will continuously fill up the variable matrix row by row.
In the separate script, I will ask the user to enter the file name (which can be different anytime) and the file name will be associated to a matrix that will be added to the .mat file.
Victor
Victor 2014 年 6 月 25 日
So every time the user enters a different file name, it will create a new variable matrix in test.mat.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by