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 CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by