help-octave
[Top][All Lists]
Advanced

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

Function of vector with meshgrid and surf


From: karl
Subject: Function of vector with meshgrid and surf
Date: Wed, 11 Nov 2015 08:28:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

I have a small problem with the syntax.

I have a function "frame" which I don't want to change since it is used in this 
form in other functions:

function fr = frame (x)
fr=x(1,:)+x(2,:);
endfunction

Now, when I want to plot the function as surface, I tried:

x1=0:0.1:1;
[X,Y]=meshgrid(x1,x1);
Z=frame([X,Y]); #<- not ok I tried different variants but all do not work
surf(X,Y,Z); #<- error message

How do I have to modify the line "Z=frame([X,Y])" that the surf command works 
and gives the surface?

Thanks
Karl



reply via email to

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