how can I multiplying matrix elements

3 visualizzazioni (ultimi 30 giorni)
Amir Ehsani
Amir Ehsani il 5 Nov 2012
How can I multiple elements of one column or row of a matrix?

Risposte (1)

Image Analyst
Image Analyst il 5 Nov 2012
% 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);

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by