how to deal with this error??

2 次查看(过去 30 天)
When i write the code i get *The variable'DG4' appears to change size on every loop iteration(within a script). Consider preallocating for speed
What should i do??
t4=122;
n4=2000;
for i=1:n4
if abs(d4(i))>t4
DG4(i)=d4(i)-((t4.^2)/d4(i));
end
end
d4 is a signal of 1x2000 double

采纳的回答

Birdman
Birdman 2017-12-26
编辑:Birdman 2017-12-26
At the beginning of the code, write
DG4=zeros(1,2000);
  1 个评论
Image Analyst
Image Analyst 2017-12-26
DG4 is NOT from that code. It's not mentioned anywhere in that code.

请先登录,再进行评论。

更多回答(1 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by