if condition on cell array
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!