how can I multiplying matrix elements
4 ビュー (過去 30 日間)
古いコメントを表示
How can I multiple elements of one column or row of a matrix?
0 件のコメント
回答 (1 件)
Image Analyst
2012 年 11 月 5 日
% Multiply a row by some number.
theRow = 42; % or whatever.
myMatrix(theRow, :) = someNumber * myMatrix(theRow, :);
% Multiply a column by some number.
theColumn = 13; % or whatever.
myMatrix(:, theColumn) = someNumber * myMatrix(:, theColumn);
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!