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!