how can I multiplying matrix elements
조회 수: 1 (최근 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!