Multiply Constant Array by Another Cell Array
2 ビュー (過去 30 日間)
表示 古いコメント
How to multiply each element of [2 3] by {(1:3)';(-1:2)'} so that the output is {[2,4,6]';[-3,0,3,6]'}?
0 件のコメント
採用された回答
Stephen23
2023 年 1 月 9 日
A = {(1:3).';(-1:2).'};
B = [2,3];
C = cellfun(@times,A,num2cell(B(:)), 'uni',0)
C{:}
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
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!