Plotting in 3d

8 visualizaciones (últimos 30 días)
Zilla Tofte
Zilla Tofte el 31 de Jul. de 2020
Comentada: madhan ravi el 31 de Jul. de 2020
How do I plot z=1/sqrt(x^2+y^2) in Matlab?

Respuestas (2)

madhan ravi
madhan ravi el 31 de Jul. de 2020
doc fsurf

Alexander
Alexander el 31 de Jul. de 2020
x = 1:0.1:10;
y = 1:0.1:10;
[X,Y] = meshgrid(x,y);
Z=1./sqrt(X.^2+Y.^2);
imagesc(x,y,Z)
  4 comentarios
Alexander
Alexander el 31 de Jul. de 2020
as an example, I plotted x/y in 1 to 10 range. You can substitute with whatever ranges you need. "0.1" is the step for x/y variables. x = 1:0.1:10 creates a vector of number [1 1.1 1.2 ..... 9.9 10].
madhan ravi
madhan ravi el 31 de Jul. de 2020
surf() instead of imagesc()

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by