Warning: Matrix is singular to working precision.
Show older comments
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')
Accepted Answer
More Answers (0)
Categories
Find more on Color and Styling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!