Borrar filtros
Borrar filtros

How can I adjust data to make it a percentage of 1000

1 visualización (últimos 30 días)
Glowworm8
Glowworm8 el 19 de Jun. de 2018
Editada: Glowworm8 el 19 de Jun. de 2018
I have a fixed 3x14 matrix and need to divide each row by the total sum of the matrix then multiply it by 1000 so it appears normalised to 1000 on the Y axis of a bar chart it feeds into, but am unsure how to do it

Respuesta aceptada

KSSV
KSSV el 19 de Jun. de 2018
A = rand(3,14) ;
thesum = sum(A(:)) ;
iwant = A/thesum*1000 ;
  1 comentario
Glowworm8
Glowworm8 el 19 de Jun. de 2018
thank you! will rand not give me random values? I already have the values in a matrix called mix2, can I replace rand with mix2?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by