how can I multiplying matrix elements

조회 수: 1 (최근 30일)
Amir Ehsani
Amir Ehsani 2012년 11월 5일
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