MATLAB: How to use “save” command in matlab as an indexable command

MATLABmatlab save save_in_iteration wavelet

how to use 'save' command in matlab as an indexable command matlab indexing save wavelet There is a matrix of 2550*720 dimension. Each row of this matrix is changed to an image by wavelet transform. The problem is that 'save' command in matlab, store all of 2550 images together in one image.The question is how to indexing 'save' command to store these images separately? Thank you

Best Answer

Hi Ramin,
You can use a different mat file name to save each wavelet. Since, this was placed in for loop, it is always storing the last one.
Try the modification as below:
clc; clear; close all;
load P300
load nP300
t = 1:100;
waveletname = 'db1';
P300_cwavelet=[];
ext = '.txt';
for i = 1 : size(P300,1)
y = cwt(P300(i,:),t,waveletname);
P300_cwavelet = [P300_cwavelet;y];
save(['P300_cwavelet ' num2str(i)],'P300_cwavelet'); % Name as loop index attached
end
Hope this helps.
Regards,
Sriram