pre allocating vector for loop
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Oday Shahadh
 el 12 de Jun. de 2020
  
    
    
    
    
    Comentada: Oday Shahadh
 el 12 de Jun. de 2020
            Can any one tell how to pre allocate c1?
thanks
for ii = 1:length(a11);
    c1=cross(L1(1,:),a11(ii,:));
  end
0 comentarios
Respuesta aceptada
  madhan ravi
      
      
 el 12 de Jun. de 2020
        c1 = cell(numel(a11),1); % before loop use numel instead of length
c1{ii} = ... inside loop
5 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Loops and Conditional Statements 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!