if condition on cell array
이전 댓글 표시
I have 2 cell arrays
A= n01944390
n01984695
n02056570
n02058221
n02099601
n02099712
B = n15296258 octave
n15296354 then
n15296489 shiva, shivah, shibah
n15296687 epoch, date of reference
n15296920 clotting time
n15297069 rotational latency, latency
n15297303 probation
n15297472 probation
n15297672 processing time
n15297859 air alert
I need to compare the first column if these 2 cell arrays and if they are equivalent, add the row of the matrix B to the equivalent row of matrix A
I wrote this for loop
for i=1:length(A)
if A(i) == B (i,1)
A(i,2) = B(i,2);
A(i,3) = B (i,3);
end
end
but it gives me this error message "Undefined function 'eq' for input arguments of type 'cell'."
Can anyone help me?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!