How to get NaN if the data is not in proper input format or missing?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am running a function over each table rows. It is a big table and some of the entries are 'NaN' (class: 'double') or 'none' (class: 'char'). There may some missing entries too. I want to get 'NaN' as output if any of the table entries is not a valid entry. How should I approach it? I have uploaded the table in attachment. My function is as follows.
function [logical_out, reaction_time, average_position] = new_table2(name,date,Trial)
채택된 답변
Walter Roberson
2022년 5월 31일
편집: Walter Roberson
2022년 5월 31일
https://www.mathworks.com/help/matlab/ref/standardizemissing.html
standardize missing. Then rmmissing https://www.mathworks.com/help/matlab/ref/rmmissing.html with the second output to show which rows were removed. Run the function on the reduced data, and then inject the results into a larger vector of nan values to match up to the original rows.
추가 답변 (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!