contourf function mistake for mapping
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    SCIUSCIA
 el 11 de En. de 2021
  
    
    
    
    
    Comentada: Walter Roberson
      
      
 el 11 de En. de 2021
            I am running a scritp for plotting the electromagnetic field under particular conditions. 
however, I have problems with the use of the command 
'contourf '
The error is the following 
Error using contourf 
Vector X must be strictly
increasing or strictly
decreasing with no repeated
values.
Error in
file
(line 90)
contourf([x./period-1
x./period x./period+1],
fliplr(z./period),
Z_E_intensity, v );
How should I check which one is the function which is wrong. 
1 comentario
  Walter Roberson
      
      
 el 11 de En. de 2021
				Suppose x/period = linspace(0,1) then subtract 1 would go from -1 to 0, then original value would be 0 to 1, then add 1 would be 1 to 2. But notice that 0 exactly occurs twice and 1 exactly occurs twice. Be careful concatenating full periods.
Respuesta aceptada
  Cris LaPierre
    
      
 el 11 de En. de 2021
        It says the issue is with vector X, so the problem is in x./period-1
The result must be strictly increasing or decreasing, and contain no duplicate values. The same is true for vector Y, or x./period in your code.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Contour Plots 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!


