Warning: Matrix is singular to working precision.

Hello, I am trying to create a surface plot with the following equations but I keep getting the message "Warning: Matrix is singular to working precision." and I'm not sure what to do.
clear
clc
x=(0:1:4);
y=(-2:1:2);
[xx,yy]=meshgrid(x,y);
ox = (-2/pi)*(xx.^3/((xx.^2+yy.^2).^2));
oy = (-2/pi)*((xx.*yy.^2)/((xx.^2+yy.^2).^2));
txy = (-2/pi)*((xx.^2.*yy)/((xx.^2+yy.^2).^2));
zz = sqrt(((ox-oy)./2).^(2)+txy.^(2));
surf(xx,yy,zz);
xlabel('Particle position in the x-axis (m)')
ylabel('Particle position in the y-axis (m)')
zlabel('Electric Potential')
title('Electric Field')
view(45,25)
colormap jet
h = colorbar;
ylabel(h, 'Electric Potential')

 Respuesta aceptada

Steven Lord
Steven Lord el 9 de Feb. de 2021

1 voto

See this documentation page for an explanation of the difference between the / and ./ operators.

Más respuestas (0)

Categorías

Más información sobre Color and Styling en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Preguntada:

el 9 de Feb. de 2021

Respondida:

el 9 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by