Info
This question is closed. Reopen it to edit or answer.
graph theory if time equals 40189 graph all 40189's source and target
1 view (last 30 days)
Show older comments
hello everyone , im wrote this code for if time(i) cell 40189 then create all array and group all 40189 information.after then digraph only this time data. But i have 40189 - 42380 about 24356 length data . how can create loop .2 weeks i cannot find a solution.
data = xlsread('veri.csv');
source = data(:,1)
target = data(:,2)
rating = data(:,3)
time = data(:,5)
i = length(source)
for index = 1 :i
if (time(index)== 40189 )
s(index) = source(index)
t(index) = target(index)
weights(index) = rating(index);
end;
end;
s( :, ~any(s,1) ) = []
t( :, ~any(t,1) ) = []
weights( :, ~any(weights,1) ) = []
if ( max(s) > max(t))
a = max(s)
else
a = max(t)
end;
G = digraph(s,t,weights,a)
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!