Info
此问题已关闭。 请重新打开它进行编辑或回答。
comparing rows in cell array
1 次查看(过去 30 天)
显示 更早的评论
Allcases = readtable('227.xlsx');
caseID = Allcases{:,1};
caseX = Allcases{:,2};
caseY = Allcases{:,3};
i = 1
f = {}
while i<5
g = {caseID(i), caseX(i), caseY(i)}
if *****************:
f = [f;g];
end
i = i+1;
end
Hi, I am trying to build a cell array of unique values. In this case, I am only trying to add the row g to f if it hasn't occured before in f. Could anyone please help me complete the missing code? I am very new to Matlab and have been spending hours to try and fix this problem.
1 个评论
Guillaume
2020-2-27
Note that:
i = 1;
while i < 5
%... some code that doesn't change i
i = i+5;
end
is more simply written as:
for i = 1:5
%... some code that doesn't change i
end
回答(1 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!