Clear Filters
Clear Filters

help using bsxfun to multiplay different size matrixes

5 views (last 30 days)
I want to make the following:
create a matrix that has one more diamention the the matrix norm_mode (actuatty is to make a norm_mode a time function)
to accelrate it on matlab I tryied the use of bsxfun, but I get the error : "Non-singleton dimensions of the two input arrays must match each other."
Please help me fix it, I cant tell where the problem is.
tmp = zeros(newSize, newSize, length(others.t));
for idx_t = 1:length(t)
tmp(:,:,idx_t) = norm_mode(:,:) .* fields(idx_t,3) ;
tmp = bsxfun(@times, norm_mode, fields(:, ii));

Accepted Answer

Stephen23 on 20 May 2024
Edited: Stephen23 on 20 May 2024
tmp = bsxfun(@times, norm_mode, reshape(fields(:,3),1,1,[]))

Sign in to comment.

More Answers (0)


Find more on Manage Products 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!