help-octave
[Top][All Lists]
Advanced

[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:29:58 +1000
User-agent: Opera Mail/12.15 (Linux)

Dmitri,

On Thu, 11 Apr 2013 13:17:47 +1000, Terry Duell <address@hidden> wrote:


Sorry -- it is getting late here and I am tired:

Must be catching...see below.

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.

It finally dawned on me...the mental block was quite big :-)

This works, as I require...

spac2 = 12.0;
for i=1:n
        for j =1:num1
                x(j) = j*spac1;
                y(i) = i*spac2;
                z(i,j) = profile(2,j);
        end
end
surf(x,y,z)

Many thanks for your help.

Cheers,
--
Regards,
Terry Duell


reply via email to

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