Finding Table Column Mean, Median and Display
Show older comments
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!

Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!