How to deal with this grpstat error message
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Image Analyst
2022년 5월 15일
You need to have braces around the average and sum, not brackets
{"average", "sum"}
댓글 수: 4
String arrays are actually allowed there.
load patients
tbl = table(Gender,Age,Weight,Smoker);
tblstats = grpstats(tbl,["Gender","Smoker"],["mean","sum"],"DataVars","Weight")
It's easy to get muddled, because if you specify the input arguments as character arrays rather than strings, then you do need to use curly braces. (Notice the single quotes rather than the double quotes around the arguments.)
load patients
tbl = table(Gender,Age,Weight,Smoker);
tblstats = grpstats(tbl,{'Gender','Smoker'},{'mean','sum'},'DataVars','Weight')
alpedhuez
2022년 5월 15일
카테고리
도움말 센터 및 File Exchange에서 Repeated Measures and MANOVA에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
