Borrar filtros
Borrar filtros

help using bsxfun to multiplay different size matrixes

1 visualización (últimos 30 días)
barak messica
barak messica el 20 de Mayo de 2024
Comentada: barak messica el 20 de Mayo de 2024
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) ;
end
tmp = bsxfun(@times, norm_mode, fields(:, ii));

Respuesta aceptada

Stephen23
Stephen23 el 20 de Mayo de 2024
Editada: Stephen23 el 20 de Mayo de 2024
tmp = bsxfun(@times, norm_mode, reshape(fields(:,3),1,1,[]))
  3 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Manage Products en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by