Error using ==> plot

조회 수: 9 (최근 30일)
kash
kash 2012년 6월 1일
I have a code
x = rand(64,64,16);
J = 1;
[Faf, Fsf] = FSfarras;
[af, sf] = dualfilt1;T=10;
w = dualtree3D(x, J, Faf, af);
details = Erry{1}{1}{1};
energy = sum(sum(abs(details).^2));
then i plotted the graph using plot command
plot(energy)
but i get errror
Error using ==> plot
Data may not have more than 2 dimensions
please help
  댓글 수: 1
Roy Veldhuizen
Roy Veldhuizen 2012년 6월 1일
Matlab gives an error, saying that Fsfarras is unknown, which indicates that there might be more code that is used in this problem. As such, I'm not able to recreate the error.
My guess is that you're trying to plot a more than 2 dimensions matrix.
plot only accepts m x 1, or 1 x n matrices.
If you want have a 3 dimensional matrix A= [x,y,z] and you want to plot A(x,1,1) versus A(1,y,1)
specify plot(A(:,1,1),A(1,y,1))
I'm not sure if this answers your question, if not, please post more of the preceding code, such that i can reproduce the error.

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King
Wayne King 2012년 6월 1일
Hi Kash, I think you need to form the complex-valued matrices out of the two DWT trees and then sum the squared magnitudes from all the detail subband matrices. See this example.
x = rand(64,64,16);
J = 1;
[Faf, Fsf] = FSfarras;
[af, sf] = dualfilt1;T=10;
w = dualtree3D(x, J, Faf, af);
for k = 1:7
coefs = w{1}{1}{k}+1j*w{1}{2}{k};
energy(k) = sum(abs(coefs(:)).^2);
end
plot(energy,'b^-','markerfacecolor',[0 0 1])
xlabel('Detail Subbands'); ylabel('Energy');
  댓글 수: 3
Wayne King
Wayne King 2012년 6월 1일
The "missing" subband is the LLL, which is in the approximation, w{2}
kash
kash 2012년 6월 1일
ok can we plot that also

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by