I am trying to create a surface plot with nested loops and am getting the error "Z must be a matrix, not a scalar or vector."
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
clear all
n=1;
for ii = 1:10;
    for jj = 1:10;
        x(n) = ii;
        y(n) = jj;
        z(n) = ii+jj;
        n = n+1;
    end
end
surf(x,y,z)
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
				Más información sobre Graphics Performance 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!

