inner matrix dimensions must agree

??? Error using ==> mtimes Inner matrix dimensions must agree.
Error in ==> Untitled at 516 Fobj =HM*fobj ;
how can i solve this problem

 Accepted Answer

For a matrix multiplication, if HM is r1 rows by c1 columns, and fobj is r2 rows and c2 columns, then c1 must equal r2. So essentially it's like r1-by-c1 * c1-by-r2. The inner dimensions are now both c1 and it will work.
On the other hand if you want element-by-element multiplication then r1 must equal r2 and c1 must equal c2. THEN you can do:
Fobj = HM .* fobj; % Use dot star instead of just star.

More Answers (1)

Categories

Community Treasure Hunt

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

Start Hunting!