error + matrix dimension must agree

2 views (last 30 days)
Nik
Nik on 16 Mar 2014
Edited: Nik on 19 Mar 2014
I got error -- Error using + Matrix dimensions must agree.
on this code. Please help me
a=sign(X(ind1)).*(abs(X(ind1))-T);
b=abs(X);
c=plus(a,b);

Accepted Answer

Mischa Kim
Mischa Kim on 16 Mar 2014
Edited: Mischa Kim on 16 Mar 2014
Nik, X and T need to be same-sized vectors unless T is a scalar.
What are you trying to do in
a = sign(X(ind1)).*(abs(X(ind1))-T);
especially w.r.t. T?
  3 Comments
Mischa Kim
Mischa Kim on 18 Mar 2014
What are the sizes of X and T? Is T a scalar?
Nik
Nik on 19 Mar 2014
Edited: Nik on 19 Mar 2014
Sir Mischa, T is:
M=size(pic,1)^2;
T=sig*sqrt(2*log(M));
while X is the wavelet coefficient value. TQVM.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!