MATLAB Corrcoef calculation - How do i create a column with the corrcoef?
2 views (last 30 days)
Show older comments
Hey guys i have a question:
Time = std(TTTZ{:,5})
GPA = std(TTTZ{:,10})
I have a table (15x40), I want to get the corrcoef for each row relevant to the mean, how would i go about calculating this and creating
a new column with each result? So far i tried:
TTTZ{:,16} = corrcoef(TTTZ{:,8})-T1{:,16} but this doesn't use the mean and im stumped.
1 Comment
Image Analyst
on 29 Nov 2020
Attach the table in a .mat file. What do the different columns mean? Does it make sense to take the mean of each row over all 40 columns? Do the 40 columns all represent basically the same thing, with the same units? Why correlate each row with a scalar (the mean of the row over all 40 columns)? The mean doesn't vary! Wouldn't it make more sense to compute the mean absolute difference or the median absolute difference?
By the way you might want to use table2array() to help you. Something like
t = table2array(TTTZ);
meansOfRows = mean(t, 2);
mads = mean(abs(t - meansOfRows)); % Hopefully will do implicit expansion.
Answers (0)
See Also
Categories
Find more on Logical 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!