What is the for loop that I can use to do the following then save the results as .mat file?

2 vues (au cours des 30 derniers jours)
What is the for loop that I can use to do the following then save the results as .mat file?
I have 30 iterations and in each iteration I want to save the following:
Image with size 120*120 *1* 6000
Labels with size: 1*6000
E= 1*6000
and I will repeat the 30 iterations for 12 experiments (12 run).
Which means in each run will get the above files 30 times
  4 commentaires
M
M le 6 Nov 2023
@Torsten, Correct, E Variable (double) I need to save
M
M le 6 Nov 2023
@Dyuman Joshi, I want save them as .mat files for further analysis.

Connectez-vous pour commenter.

Réponse acceptée

Dyuman Joshi
Dyuman Joshi le 6 Nov 2023
Preallocate arrays according to the final size and the data type and modify the arrays iteratively.
Use indexing to obtain the corresponding data.
  8 commentaires
M
M le 6 Nov 2023
@Dyuman Joshi Thanks the 2nd solution worked but when I tried to save the results I got the following:
Warning: Variable 'Images' was not saved. For variables larger than 2GB use
MAT-file version 7.3 or later.
What can I do in this case?
Dyuman Joshi
Dyuman Joshi le 6 Nov 2023
Modifié(e) : Dyuman Joshi le 6 Nov 2023
@M - Does your PC have a 64 bit processor?
Also, check the setting of version of MAT-Files in your MATLAB - https://in.mathworks.com/help/matlab/import_export/mat-file-versions.html
Make sure the selected version is MAT-File Version 7.3

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by