how I can automatically save the output of a for loop?

3 ビュー (過去 30 日間)
Francesca Di Nicola
Francesca Di Nicola 2015 年 3 月 8 日
コメント済み: Star Strider 2015 年 3 月 8 日
I created a loop that performs operations on a series of 2D matrices, each cycle I want to save the output matrix, so I need a way to automatically save these matrices creating an automatic generation of file names
  3 件のコメント
Francesca Di Nicola
Francesca Di Nicola 2015 年 3 月 8 日
Thanks, I try
Francesca Di Nicola
Francesca Di Nicola 2015 年 3 月 8 日
I created a Cell Arrays (1x200), now, how can I save the numerical matrix?

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

回答 (1 件)

Star Strider
Star Strider 2015 年 3 月 8 日
編集済み: Star Strider 2015 年 3 月 8 日
If you’re creating a series of 2D matrices, I would concatenate them into a single resultant 3D matrix (use something like: Savemat=cat(3, Savemat, Mat); then save the updated ‘Savemat’ in the same .mat file at each iteration, or preferably after the loop.
That way, you have all your 2D matrices in one 3D matrix that you can load from one file and easily address in your code.
  6 件のコメント
Francesca Di Nicola
Francesca Di Nicola 2015 年 3 月 8 日
編集済み: Francesca Di Nicola 2015 年 3 月 8 日
I have 16 data series, each series has 9000 file.mat, each file.mat contains a matrix (480x640) with temperature data. This matrix in all the files is called Frame. I need to: create a matrix that will call COND, cutting Frame to delete the data that are not needed, the difference with the T reference and then divide by a costane. create a matrix that will call CONV containing the media space of the Frame and then make a difference with the T reference make the product element by element between CONV and COND
this for each file.mat obviously I need to implement an automated way
Star Strider
Star Strider 2015 年 3 月 8 日
This seems quite distant from your original Question here.
Create a new Question that describes in some detail what you really want to do, expanding on your last Comment. It seems like a much more complicated project than I want to deal with.
Write the code to implement it yourself. If you have problems with your code, post the relevant parts of it along with a description of what you want your code to do and what it is doing, including the entire red text of any error messages that your code throws.
We will then help you get it to run.
I will delete my Answer — including this Comment — in a few hours, since it does not address your actual problem.

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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by