How to Scale Gradient Field for large z-values?

2 visualizaciones (últimos 30 días)
Niklas Kurz
Niklas Kurz el 29 de Abr. de 2021
I want to plot a function R^2 -> R with gradient Field beneath:
f2 = @(x,y) 1./sqrt(x.^2+y.^2);
[u2,v2] = meshgrid(-1:0.01:1);
[du2,dv2] = gradient(f2(u2,v2));
s = surf(u2,v2,f2(u2,v2));
hold on
contour(u2,v2,f2(u2,v2))
hold on
norm = 1./sqrt(du2.^2+dv2.^2);
quiver(u2,v2,du2./norm,dv2./norm,'LineWidth',2)
axis([-1 1 -1 1 0 10])
caxis([0,10])
colormap(cool)
alpha(s,0.95)
shading flat
Sadly the gradient field is not visible. Probably because it's too small, f2 get's too large and I'm lacking of the mathmatical knowledge to adjust it properly

Respuestas (0)

Categorías

Más información sobre Orange 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