Receiving 'Dimensions of arrays being concatenated are not consistent.' error, but there are equal amounts of rows being input.

1 回表示 (過去 30 日間)
I am trying to make a table where the first column is variable names, and the second is variable data. I have tried;
T = table(['mean';'sem';'std';'var';'min';'max';'range';'meanci'],[Mean, Std_Error, Deviation, Variance, Min, Max, Range, Confidence_95]);
And
T = table(['mean';'sem';'std';'var';'min';'max';'range';'meanci'],[Mean; Std_Error; Deviation; Variance; Min; Max; Range; Confidence_95]);
The variables are coming from the following liine earlier in the script;
[Mean,Std_Error,Deviation,Variance,Min,Max,Range,Confidence_95] = grpstats(sampledata,[],{'mean','sem','std','var','min','max','range','meanci'});
I am definitely just doing something silly as I a terrible at Matlab.
Thanks in advance!

採用された回答

Stephan
Stephan 2019 年 2 月 15 日
Hi,
try:
T = table(Mean, Std_Error, Deviation, Variance, Min, Max, Range, Confidence_95,'VariableNames',{'mean','sem','std','var','min','max','range','meanci'})
Best regards
Stephan
  2 件のコメント
Stephen
Stephen 2019 年 2 月 15 日
Thanks Stephan! That's got the variable names correct and I can certainly use it.
Is there a simple way to transpose them to columns (for neatness sake in a report), if not this will do fine :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by