Finding Table Column Mean, Median and Display
이전 댓글 표시
So I have a Matlab table named wow. I want to find the mean, median of the same and display it in my plot. Here is my code till now:
So my table looks like:
Val1 Val2 Val2 Val4
String String float float
String String float float
...
I am line plotting certain specific Val1 and Val2 pairs via.
T1 = wow(strcmp(wow.Val1, 'Some String') & strcmp(wow.Val2, 'Some String'), :) ;
T2 = wow(strcmp(wow.Val1, 'Some String') & strcmp(wow.Val2, 'Some String'), :) ;
...
subplot1(9, 9, 'Gap', [.01 .02], 'XTickL','Margin','YTickL','Margin','FontS',4);
subplot1(1)
plot( T1.Val3, T1.Val4)
subplot1(9, 9, 'Gap', [.01 .02], 'XTickL','Margin','YTickL','Margin','FontS',4);
subplot1(2)
plot( T2.Val3, T2.Val4)
So, I want to show the mean and median of the Val4 column in each of the plots. That is, I just want to draw a line for the mean and median as it would do using the Data Statistics toolbox.

However, when I use the GUI, as soon as I select data2, my lines for data one disappear!

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!