필터 지우기
필터 지우기

Cross tabulation row percentages

조회 수: 5 (최근 30일)
Sarah Yun
Sarah Yun 2019년 12월 31일
편집: TADA 2019년 12월 31일
Hello,
I have a table with 4 columns and 5 rows
I want to display the row values as percentages
example
date sale 1 sale 2 total sales
1989 4 (x%) 3 (x%) 7(x%)
7 would be 100%
now express 4 and 3 in terms of 100%?
How to do this for my table in matlab?
Thank you.

채택된 답변

TADA
TADA 2019년 12월 31일
편집: TADA 2019년 12월 31일
How about something like that?
t{:,{'sale1','sale2'}} = t{:,{'sale1','sale2'}}./t.totalsales * 100
Given that t is your table, or a copy of that so you don't override your original data

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by