Random Vertical Lines in Contour Plot. HELP! SRS

4 views (last 30 days)
Hello all, I am having trouble with making a contour plot . Each time I run the code I get vertical lines throughout the plot.
clear all;close all;clc;
a=1; b=1.5; %a<b
c=a*a/b;
S=10/(2*pi);
[x,y]=meshgrid(linspace(-2,2,100),linspace(0,2,100));
theta1=atan(y./x); %for sink at origin
theta2=atan(y./(x-c)); %for source at (a^2 /b ,0)
theta3=atan(y./(x-b)); %for source at (b,0)
psi=S*(-theta1 + theta2 + theta3);
contour(x,y,psi);
Problem is similar to (though no solution was provided) http://www.mathworks.com/matlabcentral/answers/20951-contour-plot-problem
Any help appreciated!! Thanks

Answers (1)

Adam Weiss
Adam Weiss on 5 Feb 2015
It should look like:

Categories

Find more on Contour Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!