I would like to know how to attribute variable names in a Table

The problem is the following, I have a fairly big matrix (267 by 9) with data. Through a function I have calculated the basic stats of this collection of data (mean, standard deviation, skewness, kurtosis, median, maximum and minimum). Now I would like to display the information in a table to have a more clear view of the results. In the MatLab Documentation, this is said about assigning variable names "The variable names that you assign must be valid MATLAB® variable names". I don't understand very well what this means. I suppose that the variable names have to be something that MatLab recognizes as a function.
But when I press the 'run section' button it gives me an error saying (invalid parameter name: std)
The code below is what I have written:
[media,desviopadrao,skewness,kurtosis,mediana,maximo,minimo]=basicstats(ReturnsMatrix)
T=table(media',desviopadrao',skewness',kurtosis',mediana',maximo',minimo','VariableNames','mean','std','skewness','kurtosis','median','max','min')

 Accepted Answer

T = table(media', desviopadrao', skewness', kurtosis', mediana', maximo', minimo', 'VariableNames', {'mean', 'std', 'skewness', 'kurtosis', 'median', 'max', 'min'} );

More Answers (2)

Many Thanks Walter, I've just discovered that now. This community is awesome.
Walter's answer is correct, but if you are able to create all those vectors as columns, not rows, then
T = table(media, desviopadrao, skewness, kurtosis, mediana, maximo, minimo)
would pick up the workspace variable names automatically. But I see t6hat the names you've passed in are actually different from the workspace names, so maybe that's not of interest.

Categories

Find more on Psychology 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!