function acontour(x,y,z,N); % Last modified 05.08.00 % For Matlab 5.x % File: acontour.m % By Igor Kagan % kigor@tx.technion.ac.il % http://igoresha.virtualave.net % % Short Description: % Plots arbitrary (not rectangular) contours % % Usage: acontour(xdata, ydata, zdata, NumberOfContourLines) % Inputs: % (1) X data % (2) Y data % (3) Z data % (all vectors must be of the same length) % (4) Number of contour lines % Outputs: % None if sum(diff([length(x) length(y) length(z)])) errordlg('Vectors must be of the same length!','acontour.m error'); return; end X = unique(x); Y = unique(y); Z = zeros(length(Y),length(X)); for k=1:length(z), indx = find(X==x(k)); indy = find(Y==y(k)); Z(indy, indx) = z(k); end contour(X,Y,Z,N);