How to multiply some columns in matrix by scalar
3 ビュー (過去 30 日間)
古いコメントを表示
I have a matrix with 12 columns. I want to multiply all columns except the first two by 100 and leave the first two the same, then output all this into a new matrix. How do i do this?
railwayarcsBIG = railwayarcs(:,2:12)*100;
% this code does not return the first two columns, it eliminates them and
% only does the scalar multiplication
0 件のコメント
回答 (1 件)
David Hill
2022 年 3 月 25 日
編集済み: David Hill
2022 年 3 月 25 日
railwayarcsBIG=railwayarcs;
railwayarcsBIG(:,3:12)=railwayarcsBIG(:,3:12)*100;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!