how can I multiplying matrix elements

4 次查看(过去 30 天)
How can I multiple elements of one column or row of a matrix?

回答(1 个)

Image Analyst
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);

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by