MATLAB Answers

Multiply a column by a number

조회 수: 206(최근 30일)
How Could I simply multiply each element of this array by 4? A=array(:,6);

  댓글 수: 0

로그인 to comment.

채택된 답변

David Fletcher
David Fletcher 30 Mar 2018
A=A.*4

  댓글 수: 0

로그인 to comment.

More Answers (1)

Roger Stafford
Roger Stafford 30 Mar 2018
Let Ar be the name of the array.
Ar(:,6) = 4*Ar(:,6);
What could be simpler? Since 4 is a scalar, it is automatically applied to each element of that column.

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by