필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Glowworm8
Glowworm8 2018년 6월 19일
편집: Glowworm8 2018년 6월 19일
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

채택된 답변

KSSV
KSSV 2018년 6월 19일
A = rand(3,14) ;
thesum = sum(A(:)) ;
iwant = A/thesum*1000 ;
  댓글 수: 1
Glowworm8
Glowworm8 2018년 6월 19일
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?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by