What wrong with this code guys?,help me please!

<<
>>

2 Commenti

Tell the size/ dimensions of temp and cD(jj+1)....
Please post code as text, not as screen shots. Then it would be much easier to suggest a solution with copy&paste.

Risposte (2)

Notes: The "clear temp" is a waste of time, because you define the variable "temp" in the next line again. Then the former value is cleared at all.
The loop can be omitted:
temp = cat(1, cD{:});
This will produce the same error, because the dimensions of cD do not allow a concatenation along the 1st dimension.
If cD is the output of a wavelet transform, then the different cD entries are going to be different sizes, and cannot be put together using cat in that form. If you needed a single vector of all of the coefficients then you could use
cell2mat( cellfun(@(V) V(:), cD(:), 'uniform', 0) )
for a one-line solution. Or in terms of loops,
temp = cD{1}(:);
for jj = 2 : dwtlevel
temp = [temp; cD{jj}(:)];
end

Questa domanda è chiusa.

Richiesto:

il 22 Gen 2018

Chiuso:

il 20 Ago 2021

Community Treasure Hunt

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

Start Hunting!

Translated by