15,908,768 members
See more:
Hi,
how can i create a Cone without using matlab builtin function?
Posted
Updated 23-Dec-13 4:51am
v2
[no name] 23-Dec-13 9:22am
Read the manuals and google first. Nobody here is keen on doing the work for you!
m.r.m.40 23-Dec-13 9:24am
lol.
Richard MacCutchan 23-Dec-13 10:48am
The same way you create a sphere: by writing some code.
m.r.m.40 23-Dec-13 12:54pm
very clever,
Thank you.
you can read the comments under the previous question you may get something.
Richard MacCutchan 23-Dec-13 13:00pm
I don't need anything.

## Solution 2

here it is,
code of a circle then by changing the z as the circle height and changing the r as its radius i can create a cone( at least something like it ).
VB
```r=1
teta=-pi:0.01:pi
x=r*cos(teta);
y=r*sin(teta);
z=zeros(1,numel(x));
plot3(x,y,z);
hold on

% ----------------------------------- %

for i = 1 : 20
z=z+0.05;
r=r-0.05;
x=r*cos(teta);
y=r*sin(teta);
plot3(x,y,z);
hold on
end
hold off```

m.r.m.40 1-Jan-14 23:47pm
http://www.codeproject.com/Questions/701032/math-equation-MATLAB

well this is the cone and for creating a sphere using same formula i need to give the circle a little slope instead of giving it height( means the same center(x,y,z) but different angle )