B=[nan 8 nan;6 nan nan;6 5 8] C=[nan 4 nan;4 nan nan;5 3 2]
Answer: B=[8 6 6 5 8] C=[4 4 5 3 2]

 채택된 답변

Guillaume
Guillaume 2015년 1월 13일
편집: Guillaume 2015년 1월 13일

5 개 추천

B = B';
B = B(~isnan(B))';
C = C';
C = C(~isnan(C))';

댓글 수: 3

You need a reassignment to B and C too in there:
B = B(~isnan(B))';
C = C(~isnan(C))';
Guillaume
Guillaume 2015년 1월 13일
Yes, not sure what I was thinking.
Yang Liu
Yang Liu 2022년 8월 4일
Why use '? Why not just B=B(~isnan(B))?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2015년 1월 13일

댓글:

2022년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by