[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to plot surface using scaled axes values, not indexes
From: |
Terry Duell |
Subject: |
Re: How to plot surface using scaled axes values, not indexes |
Date: |
Thu, 11 Apr 2013 13:17:47 +1000 |
User-agent: |
Opera Mail/12.15 (Linux) |
Hello Dmitri,
On Thu, 11 Apr 2013 12:44:02 +1000, Dmitri A. Sergatskov
<address@hidden> wrote:
On Wed, Apr 10, 2013 at 9:39 PM, Dmitri A. Sergatskov <
address@hidden> wrote:
In your case it would be something along the lines:
xx = jj*spac1; yy = ii*spac2; [x,y] = meshgrid(xx,yy); surf(x,y,z)
Sorry -- it is getting late here and I am tired: forget about meshgrid
part,
Yes, I had lookked at meshgrid a few times, but couldn't see how I could
apply it when I don't have a function.
just x = jj*spac1; y = ii*spac2; surf(x,y,z) should work.
Sorry to continue to be dense on this, but does the above fit in with my
code snippet?
Is your jj my j, and your ii my i? What is z in the above?
If I do...
y = zeros(n,num1);
spac2 = 12.0;
for i=1:n
for j =1:num1
x = j*spac1;
y = i* spac2;
z(i,j) = profile(2,j);
end
end
surf(x,y,z)
I get...
error: surface: rows (Z) must be the same as length (Y) and columns (Z)
must be the same as length (X)
So I am clearly misunderstanding your meaning.
You may want to look at xode for sombrero() as an example.
This is still might be a good idea.
Looked a few times, but can't see how it helps.
--
Regards,
Terry Duell