Assigning multiple outputs from a function to the multiple variables and repeat the same for several inputs to the function

Dear friends,
I am working on Hyperspectral Image feature extraction. Suppose the dimension of the image is 145*145*200, representing 145 rows and columns with 200 channels. Now I need to apply EWT (Empirical Wavelet Transforms) using the toolbox given in https://in.mathworks.com/matlabcentral/fileexchange/42141-empirical-wavelet-transforms on individual channels of the image. Suppose I use function [ewtC,mfbR,mfbC,BR,BC] = EWT2D_Tensor(im,params) for this purpose, how I can capture ewtC (structure containing all subband images) output for all the 200 channels. Can anyone please suggest me corrections for my code below:
for i in 1:200
ewtc(:),~,~,~,~ = EWT2D_Tensor(im(:,:,i,N =2);
end

回答(1 个)

Please read Matlab's Onramp to learn the basics. It is not efficient to repeat the tutorials in the forum.
params.N = 2;
for i = 1:200
[ewtc,~,~,~,~] = EWT2D_Tensor(im(:,:,i), params);
end

类别

帮助中心File Exchange 中查找有关 Denoising and Compression 的更多信息

产品

版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by