if condition on cell array
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!