フィルターのクリア

help using bsxfun to multiplay different size matrixes

1 回表示 (過去 30 日間)
barak messica
barak messica 2024 年 5 月 20 日
コメント済み: barak messica 2024 年 5 月 20 日
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));

採用された回答

Stephen23
Stephen23 2024 年 5 月 20 日
編集済み: Stephen23 2024 年 5 月 20 日
tmp = bsxfun(@times, norm_mode, reshape(fields(:,3),1,1,[]))
  3 件のコメント
Stephen23
Stephen23 2024 年 5 月 20 日
@barak messica: I edited my answer.
barak messica
barak messica 2024 年 5 月 20 日
Works
Thanks :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by