Any "function name" that includes colons inside the name like stats::correlation are functions intended to be called from a MuPAD notebook or via symengine. They cannot be called directly from the MATLAB prompt or in a MATLAB program file (without using symengine.) Working with variables in a timetable is easy. Using the example timetable from the documentation: Time = datetime({'2015-12-18 08:03:05';'2015-12-18 10:03:17';'2015-12-18 12:03:13'});
Temp = [37.3;39.1;42.3];
Pressure = [30.1;30.03;29.9];
WindSpeed = [13.4;6.5;7.3];
WindDirection = categorical({'NW';'N';'NW'});
TT = timetable(Time,Temp,Pressure,WindSpeed,WindDirection)
Here's how you would determine the correlation coefficient between Temp, Pressure, and WindSpeed with corrcoef:
C1 = corrcoef(TT.Temp, TT.Pressure)
C2 = corrcoef([TT.Temp, TT.Pressure, TT.WindSpeed])
If TT did not have a categorical variable, you could concatenate all its variables together and then computing C2 would be easier.
TT2 = TT;
TT2.WindDirection = []
C2a = corrcoef(TT2.Variables)
Best Answer