目前我可以:
edges(1000000) = struct('weight',1.0); //This really does not assign the value, I checked on 2009A.
for i=1:1000000; edges(i).weight=1.0; end;
但是那样很慢,我想做一些更像
edges(:).weight=[rand(1000000,1)]; //with or without the square brackets.
有什么想法/建议可以将这个赋值向量化,以使其更快。
提前致谢。