how to solve this error ? the horzcat Dimensions of matrices being concatenated are not consistent

1 view (last 30 days)
i am using of curvelet first generation code in my project. but when i call the curvelet function in main code this error appears in this section of curvelet code and main code : Error using horzcat Dimensions of matrices being concatenated are not consistent.
Error in iso_fuwt2_po (line49) x = [zeros(floor(ls/2),n) x zeros(ceil(ls/2),n)];
Error in cvt (line 36) D = iso_fuwt2_po( x, J, hr );% fine to coarse
Error in MainProposedCode(line 25) Dn=cvt(image1,5,[3 4 5 5 6]);
can someone show me how to handle and solve this error. thank you so much!
this is code in iso_fuwt2_po.m :
-------------------------------------------------
this is code in cvt.m :
  1 Comment
David Goodmanson
David Goodmanson on 23 Aug 2017
Hi masoom, The line x = [zeros(floor(ls/2),n) x zeros(ceil(ls/2),n)]; is bound to fail when m is odd. Since floor(ls/2) and ceil(ls/2) differ, you end up trying to horizontally concatenate arrays with numbers of rows that differ.

Sign in to comment.

Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!