help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with mesh-plot


From: Hugo Coolens
Subject: problem with mesh-plot
Date: Thu, 21 Feb 2013 13:55:54 +0100

I'm trying to make a mesh-plot as can be seen in the code below:
clear
[x, y] = ndgrid (0.1:0.1:1);
tau11=x(:);
tau22=y(:);
#tau12=0
sigma=tau11+tau22;
p=tau11.*tau22;
A=sqrt(p.^2+2*p.*sigma.^2)-p;
hjwmax=sqrt((1+A./p)./((1-A./sigma.^2).^2+A./p));
[xmax, ixmax]=max(hjwmax);
disp('de max. amplification equal to: '),disp(xmax)
disp('for this max. amplification tau11 (x-as): '), disp(tau11(ixmax))
disp('for thi smax. amplification tau22 (y-as): '), disp(tau22(ixmax))
length(tau11)
length(tau22)
length(hjwmax)
mesh(tau11,tau22,hjwmax)
#plot3(tau11,tau22,hjwmax)

I get the following error-message which puzzles me as x, y and zo do have the same length:
error: surface: rows (z) must be the same as length (y) and columns (z) must be the same as length (x)
error: called from:
error:   /usr/share/octave/3.2.4/m/plot/surface.m at line 111, column 9
error:   /usr/share/octave/3.2.4/m/plot/surface.m at line 51, column 5
error:   /usr/share/octave/3.2.4/m/plot/mesh.m at line 37, column 7
error:   /home/coolens/palp2tau12zero.m at line 14, column 1
octave:1>
gnuplot> plot "-";
              ^
         line 2: warning: Skipping data file with no valid points

what's going wrong here?
thanks in advance
hugo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]