set multiple columns of matrix simultaneously
古いコメントを表示
Hello,
I want to set multiple columns of a matrix to the same column vector. What I am currently doing is itterating over each column and changing them individually.
DM_sine = zeros(32);
for i=1:length(DM_sine);
DM_sine(:,i) = sin(2*pi*i/32);
end
This does what I want, but seems massively inefficient and inelegant. Is there a better alternative?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!