I have some prototype MATLAB code that is not required to be very fast.
An array used in the code grows in size, and MATLAB Code Analyzer displays the warning "consider preallocating for speed" in the MATLAB editor. However, I can't know the final size of the array because a decision is taken during its growing process, and I therefore don't wish to preallocate it.
How can I disable the "consider preallocating for speed" warning displayed by MATLAB Code Analyzer in the MATLAB editor?
With the Editor open, you could right-click the orange squiggly line and select suppress "<warning msg>" on this line
. This will insert a comment %#ok<SAGROW>
telling MATLAB Code Analyzer to suppress this warning:
p = [];
for i=1:1000
p(i) = i; %#ok<SAGROW>
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With