Variable lamb1 appears to change size on every loop iteration
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
maximag=max(imag(ee));
lamb1(i1,j1)=maximag;
hello sir i m getting warning as lamb1 changes the size in every loop,because of this warning my program became very slow,can you please help me out.
2 comentarios
Smitesh Patil
el 19 de Jul. de 2021
Are you appending maximag to lamb1 inside a loop? Its not very clear from the example here.
Respuestas (2)
KSSV
el 19 de Jul. de 2021
You have to initialize that variable before using it in a llop to save/ fill the values.
lamb1 = zeros(m,n) ; % specify your dimensions
3 comentarios
KSSV
el 19 de Jul. de 2021
Show us your complete code...If j1, i1 are your idnices then you have to preallocate/ initialize lamb1.
Smitesh Patil
el 19 de Jul. de 2021
This article on Preallocation of arrays should be helpful
0 comentarios
Ver también
Categorías
Más información sobre Text Analytics Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!