简体   繁体   中英

how to use 'save' command in matlab as an indexable command

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

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','P300_cwavelet');
end

From your question and your code it looks like you have an input matrix that is 720 columns, but you want to store the wavelet transform one per column. You can do that by saving y in the for loop.

Your result array P300_cwavelet contains all columns y at the end of the for loop. You can save the complete result as well by only saving P300_cwavelet only once: after the for loop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM