Merge two colums into one

조회 수: 2 (최근 30일)
René Dienemann
René Dienemann 2019년 8월 26일
댓글: René Dienemann 2019년 8월 26일
Hi, I´m an absolutly matlab greenhorn. I hope its okay, if i ask some "maybe" stupid questions.
I have an array (6x2), in my example are these colums A and B, and I need an array (6x1) ... colum C.
How can I merge these two colums A and B to colum C?
Thanks for your help.
Best Regards
Example:
matlab_ex.jpg

채택된 답변

Jan
Jan 2019년 8월 26일
Assuming that X is your matrix:
C = X(:, 2);
match = isnan(C);
C(match) = X(match, 1);
  댓글 수: 1
René Dienemann
René Dienemann 2019년 8월 26일
perfect, thanks a lot !!!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by