help-octave
[Top][All Lists]
Advanced

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

How to make a column/cone on a surface?


From: nelse003
Subject: How to make a column/cone on a surface?
Date: Wed, 17 Nov 2010 08:42:04 -0800 (PST)

I am trying to display a cone/circular column using If statements within this
function, I have managed to set it make an rectangular shape, but i am
confused on how to change the function. I need to be able to set the
dimensions of the cone/column as arguments of the function.

function myfunk5(k,a,h,b)
fy=(rand(1,1));
fx=(rand(1,1));
Mx=50;
My=50;
for i=1:100
for j=1:100
 if i>=j ((i<=Mx+a)&(i>=Mx-a))&((j<=My+b)&(j>=My-b))

z(i,j)=h;
else
z(i,j)=sin((k*i)+fx)*cos((k)+fy);

if i<=j ((i<=Mx+a)&(i>=Mx-a))&((j<=My+b)&(j>=My-b))

z(i,j)=h;
else
z(i,j)=sin((k*i)+fx)*cos((k*j)+fy);
end
end
end
end
surf(z) 
view(45,45);
shading interp;
http://octave.1599824.n4.nabble.com/file/n3047123/9n-3.jpg 

-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/How-to-make-a-column-cone-on-a-surface-tp3047123p3047123.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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