Logical Indexing problem with vector lengths
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Christopher
      
 el 9 de Mzo. de 2014
  
    
    
    
    
    Respondida: Paul
      
 el 9 de Mzo. de 2014
            The following statements result in the 'the number of elements in B and I must be the same' error:
 P=[1 6 2 2 2 5 9 1 3]'
 M=[5 6 4 7 8 0 5 3 7]'
 grid=[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5]'
 P(M>grid(P)) = P+1;
Why is this not correct?
0 comentarios
Respuesta aceptada
  Paul
      
 el 9 de Mzo. de 2014
        P(M>grid(P)) = P+1;
should be
P(M>grid(P)) = P(M>grid(P))+1;
At least I guess that's what you want to do.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Matrix Indexing en Help Center y File Exchange.
			
	Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

