Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
alvaro felipe
alvaro felipe el 17 de Mzo. de 2018
Comentada: alvaro felipe el 17 de Mzo. de 2018
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!

Respuestas (1)

Rene Riha
Rene Riha el 17 de Mzo. de 2018
A(:, 1)=k.*A(:, 1)
  1 comentario
alvaro felipe
alvaro felipe el 17 de Mzo. de 2018
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

Iniciar sesión para comentar.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by