我遇到過很多MATLAB代碼,其中有%#ok<SAGROW>
評論。此評論在不同情況下使用,我無法弄清楚它的含義。%#ok <SAGROW>是什麼意思在MATLAB中表示?
舉個例子:
i = 1;
flag = true;
for l = 1:k
while(flag==true)
if(probs(i)~=0)
leaves(l).val = i-1; %#ok<*SAGROW>
leaves(l).zero = '';
leaves(l).one = '';
leaves(l).prob = probs(i);
i = i + 1;
flag = false;
else
i = i+1;
flag = true;
end
end
flag =true;
end
有此評論其他引用也爲instace:
- http://www.codeproject.com/Questions/151765/answer.aspx
- http://www.scribd.com/doc/69869075/EEE-554-Matlab-Solutions
- http://www.mathworks.com/matlabcentral/newsreader/view_thread/321047
- http://www.nd.edu/~jrunkle1/ballis_problem.m
'AGROW'是否告訴MATLAB預先分配數組/矩陣來提高性能,還是隻是抑制預分配警告? – Isaac
只需抑制警告。 – glglgl