add for loop in matlab code
2 ビュー (過去 30 日間)
古いコメントを表示
s = [2 10 10 113 119 119 54 119 119 168 271 271 271 271 271 474 37 54 113 37 168 10 168 99 10 1632 37 1127 10 1127 2 113 4 2 1 1632 2 2 1 505 121
];
t = [402 970 271 54 2 54 119 471 271 74 2 54 113 119 471 37 474 37 37 113 10 168 439 10 99 37 1632 113 2 2 1127 4 113 168 113 2 10 1632 2 121 505
];
weights = [1 8 8 4 8 5 5 9 8 1 8 7 7 8 1 1 1 5 2 5 2 2 1 2 2 2 1 1 8 1 1 5 3 9 2 3 3 2 1 1 1
];
G = digraph(s,t,weights,1632)
plot(G)
full(adjacency(G))
i need to add excel data in this code.example in excel source data added s array , target add t array and rating add weight to get graph and matrix .its change month by month .firstly added KASIM10 AFTER THEN it will be show graph and matrix after then new graph for ARALIK10 .
7 件のコメント
Walter Roberson
2018 年 3 月 3 日
You have no realistic hope of reading excel data with code you write yourself without writing at least one function: the format of .xls and .xlsx files is much too complicated to write your own code for that does not use functions.
So read the data using xlsread(). You can use a for loop to examine the data if you want. There is more than one way to represent dates in Excel so I do not know at the moment whether the "human time" column will be represented as a string or as numeric, but you probably just need to look for places that it changes
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!