필터 지우기
필터 지우기

How can I multiply only the first column of a matrix by a scalar

조회 수: 4 (최근 30일)
alvaro felipe
alvaro felipe 2018년 3월 17일
댓글: alvaro felipe 2018년 3월 17일
I have a matrix with two columns and I need to multiply only the first column by a scalar. It is the first time I use Matlab so I have no idea how to do so.
Thanks!

답변 (1개)

Rene Riha
Rene Riha 2018년 3월 17일
A(:, 1)=k.*A(:, 1)
  댓글 수: 1
alvaro felipe
alvaro felipe 2018년 3월 17일
Thank you Rene. With this code, the output is the first column of the matrix multiplied by the scalar.
Is there any way to have the original matrix (2 columns) with only the first matrix multiplied by the scalar?
Thanks again

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by