help-octave
[Top][All Lists]
Advanced

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

Re: mesh plot


From: asha g
Subject: Re: mesh plot
Date: Fri, 3 May 2013 17:46:40 +0800 (SGT)


 
        i = 1 : 5 : numel(x);
        j = 1 : 5 : numel(z);
        mesh(z(j), x(i), y(i,j))

Adjust the stride (in this case, '5') appropriately if you want more or
fewer points in your mesh plot.

Note: mesh(z(j), x(i), y(i,j)) is not a misprint.  If you use vectors as
coordinates, then number of rows of the third parameter must match the
number of elements of the *second* parameter and the number of columns
of the third parameter must match the number of elements of the first
parameter.

N = 41, iter = 111000;
vvvv(iter,:) = V;
tmax = 55; 
x= linspace(0,tmax,niter);
z = linspace(0,l,N);
y = vvvv';

On using the following 

i = 1 : 5 : numel(x);
        j = 1 : 5 : numel(z);
        mesh(z(j), x(i), y(i,j))


I get an error message at line mesh(z(j),x(i),y(i,j))

error: A(I): Index exceeds matrix dimension.

Maybe it needs to be rewritten 

Asha G 



reply via email to

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