Problem with direct calculation on table with std and "omitnan"
조회 수: 3 (최근 30일)
이전 댓글 표시
Since R2023a, it is possible to perform calculations directly on tables (and timetables) without extracting their data by indexing.
I want use std directly on a numeric table where I can have nan.
For example :
load patients
T = table(Age,Height,Weight,Systolic,Diastolic)
mean(T,"omitnan")
It's fine.
But why there is a problem with std(T,"omitnan") ?
% Applying the function 'std' to the variable 'Age' generated an error.
I can use std(T{:,:},"omitnan") or std(T.Variables,"omitnan") but I lost the possibility to work directly with my table.
Did I miss something ?
Do you have any suggestion ?
Thank you in advance.
SAINTHILLIER Jean Marie
댓글 수: 0
채택된 답변
Star Strider
2023년 5월 17일
Example —
load patients
T = table(Age,Height,Weight,Systolic,Diastolic)
S = varfun(@(x)std(x,'omitnan'),T)
.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!