Is it another command using to compare between vector and cell?
이전 댓글 표시
I have this code bellow: when U = [] and has value after , S also the same initila by S = {},
I use IsContainedIn to compare between each value fo U and S, but it doesn't work, an error appear : "Input A of class double and input B of class cell must be cell arrays of character vectors, unless one is a character vector."
Could you please help me I 'm stuck in this step
for i=1:numel(U)
if ~IsContainedIn(U(i),S{p})
w1 = [w1 U(i)];
end
end
Thanks
댓글 수: 6
Daniel M
2019년 10월 30일
Is IsContainedIn a native MATLAB function? I'm having trouble finding it.
Mira le
2019년 10월 30일
Daniel M
2019년 10월 30일
Right. Well, I'm not sure what you're storing in U and S, but have a look at ismember and strcmp
Alex Mcaulley
2019년 10월 30일
What is the content of S and U? Are you trying to merge S and U without repetitions?
Mira le
2019년 10월 30일
Mira le
2019년 10월 30일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!