Hello! I have the table attached ('egAllHitMov') which has missing values in the first 6393 rows showing as []. I tried the following line to remove them:
AllHitMov = rmmissing(AllHitMov);
But it does not work, and also does not give me an error. Do you know how I can create a new table without these lines?
Thank you!

 채택된 답변

Cris LaPierre
Cris LaPierre 2022년 9월 26일

0 개 추천

Empty is not a recognized missing value in MATLAB, so rmmissing does nothing.
Missing values are defined according to the data type of A:
  • NaN — double, single, duration, and calendarDuration
  • NaT — datetime
  • <missing> — string
  • <undefined> — categorical
  • {''} — cell of character vectors
I think the easiest way to do what you want is to convert your values from empty cell arrays to doubles. That automatically removes the empty rows.
AllHitMov = varfun(@cell2mat,AllHitMov);

댓글 수: 1

Tanika Bawa
Tanika Bawa 2022년 9월 26일
Thank you very much for the answer but also for the explanation =)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

카테고리

도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by