I want to compare two string data. but when I use the expression for and if, it can not be run.
i'm sorry... this is my code... I am a beginner, please your help.
clear;
clc;
[data2,follower]=xlsread('follower.xlsx');
[data3,mention]=xlsread('mentions.xlsx');
[data5,wg]=xlsread('wg.xlsx');
n_vertex=length(follower(:,1));
wg=0;;
for i=1:n_vertex
for j=1:n_vertex
if isequal(follower{i,1}==mention{i,1}, follower{i,2}==mention{i,2})
if follower{i,1}==wg{i,1}
wg=wg+data5(i,1)+1;
end;
end;
end
end
============================================================================== Error using ==> eq Matrix dimensions must agree.
Error in ==> oo at 17 if isequal(follower{i,1}==mention{i,1}, follower{i,2}==mention{i,2})
================================================================================ I want to make it again from (1) to n_vertex. but it seems there is something wrong .. please help, thank you.
No products are associated with this question.
6 Comments
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58051#comment_120963
Do not use the name of an individual as a Tag. Read the guide to tags and retag this question. See http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58051#comment_120983
Roza, are you sure you don't want any answers at all from anyone else on the planet except for Jan Simon (outstanding though he may be)?
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58051#comment_120999
do not like it. I am very receptive to suggestions from anyone, including you. :)
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58051#comment_121026
Roza, Do not use the name of an individual as a Tag. Read the guide to tags and retag this question. See http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58051#comment_121030
ooh hehehe... sorry, i am newbie :)... thanks for the information
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58051#comment_121086
Instead of saying sorry, it would be more efficient to edit the tag. Although there are many Jan Simon's on the earth, the most famous is a female violinist, I assume the tag means me. Therefore I feel free to delete it.
You have posted the same question already two days ago. Walter's answer suggested STRCMP() already and was accepted.
Please avoid such "double-posting", because it confuses the readers and the ones, who spend time for answering. Thanks.