if statement on cell
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have a matrix A with 3 columns. The first column contains letters (specific reference numbers) and the other two columns contain numbers (values). I also have a big table B that contains also the first column of the matrix A but its length is bigger than A's as some reference numbers are repeated. I want to add two extra columns in table B where for each reference number I get the corresponding to the reference number values of the matrix A. I tried to use the if function but it didn't work (as reference numbers are cells) and isequal is not working as the first column in A has less rows than the columns of table B. Can anyone help me with this?
댓글 수: 3
Guillaume
2018년 7월 19일
Or if the matrices were converted to tables, which sound better suited for what they contain, a single call to join would do the job.
But yes, an example of the inputs is required, particularly since matrices cannot contain both text and numbers, so it's unknown what A and B actually are.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!