Anyone have idea how to do this in Matlab?
|
|
0
|
|
|
|
Reply
|
Piya
|
1/26/2010 9:47:03 AM |
|
"Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> Anyone have idea how to do this in Matlab?
try:
help ndgrid
/Per
|
|
0
|
|
|
|
Reply
|
Per
|
1/26/2010 11:37:03 AM
|
|
"Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v$hdp$1@fred.mathworks.com>...
> "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> > Anyone have idea how to do this in Matlab?
>
> try:
> help ndgrid
>
> /Per
Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
|
|
0
|
|
|
|
Reply
|
Priya
|
1/26/2010 11:53:03 AM
|
|
"Priya " <priya.biomath@gmail.com> wrote in message <hjml2v$h9n$1@fred.mathworks.com>...
> "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v$hdp$1@fred.mathworks.com>...
> > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> > > Anyone have idea how to do this in Matlab?
> >
> > try:
> > help ndgrid
> >
> > /Per
>
> Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
What about:
xmin=0;xmax=1;Nx=10;
xvec=linspace(xmin,xmax,Nx);
yvec=xvec;zvec=5*xvec; %change here
[x,y,z] = ndgrid(xvec,yvec,zvec);
plot3(x(:),y(:),z(:),'.');axis equal;
x(2,3,5)
|
|
0
|
|
|
|
Reply
|
Per
|
1/26/2010 1:17:05 PM
|
|
"Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h$6tg$1@fred.mathworks.com>...
> "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v$h9n$1@fred.mathworks.com>...
> > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v$hdp$1@fred.mathworks.com>...
> > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> > > > Anyone have idea how to do this in Matlab?
> > >
> > > try:
> > > help ndgrid
> > >
> > > /Per
> >
> > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
>
> What about:
>
> xmin=0;xmax=1;Nx=10;
> xvec=linspace(xmin,xmax,Nx);
> yvec=xvec;zvec=5*xvec; %change here
> [x,y,z] = ndgrid(xvec,yvec,zvec);
> plot3(x(:),y(:),z(:),'.');axis equal;
>
> x(2,3,5)
It looks nice but not like cylinder
|
|
0
|
|
|
|
Reply
|
Priya
|
1/26/2010 2:54:04 PM
|
|
"Priya " <priya.biomath@gmail.com> wrote in message <hjmvmc$kbd$1@fred.mathworks.com>...
> "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h$6tg$1@fred.mathworks.com>...
> > "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v$h9n$1@fred.mathworks.com>...
> > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v$hdp$1@fred.mathworks.com>...
> > > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> > > > > Anyone have idea how to do this in Matlab?
> > > >
> > > > try:
> > > > help ndgrid
> > > >
> > > > /Per
> > >
> > > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
> >
> > What about:
> >
> > xmin=0;xmax=1;Nx=10;
> > xvec=linspace(xmin,xmax,Nx);
> > yvec=xvec;zvec=5*xvec; %change here
> > [x,y,z] = ndgrid(xvec,yvec,zvec);
> > plot3(x(:),y(:),z(:),'.');axis equal;
> >
> > x(2,3,5)
>
> It looks nice but not like cylinder
You said rectangular grid. A cylinder is a body with fixed cross-section elongated along ,lets say the z-direction. Do you want this cross section to be both a circle and rectangular? You have to approximate the circle into rectangles that fits within the radii then?
|
|
0
|
|
|
|
Reply
|
Per
|
1/26/2010 3:09:02 PM
|
|
"Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjn0ie$j0t$1@fred.mathworks.com>...
> "Priya " <priya.biomath@gmail.com> wrote in message <hjmvmc$kbd$1@fred.mathworks.com>...
> > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h$6tg$1@fred.mathworks.com>...
> > > "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v$h9n$1@fred.mathworks.com>...
> > > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v$hdp$1@fred.mathworks.com>...
> > > > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> > > > > > Anyone have idea how to do this in Matlab?
> > > > >
> > > > > try:
> > > > > help ndgrid
> > > > >
> > > > > /Per
> > > >
> > > > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
> > >
> > > What about:
> > >
> > > xmin=0;xmax=1;Nx=10;
> > > xvec=linspace(xmin,xmax,Nx);
> > > yvec=xvec;zvec=5*xvec; %change here
> > > [x,y,z] = ndgrid(xvec,yvec,zvec);
> > > plot3(x(:),y(:),z(:),'.');axis equal;
> > >
> > > x(2,3,5)
> >
> > It looks nice but not like cylinder
>
> You said rectangular grid. A cylinder is a body with fixed cross-section elongated along ,lets say the z-direction. Do you want this cross section to be both a circle and rectangular? You have to approximate the circle into rectangles that fits within the radii then?
what do you mean by "You have to approximate the circle into rectangles that fits within the radii then? "
can you write me little more about such things.
|
|
0
|
|
|
|
Reply
|
Priya
|
1/26/2010 3:14:03 PM
|
|
"Priya " <priya.biomath@gmail.com> wrote in message <hjn0rr$8kh$1@fred.mathworks.com>...
> "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjn0ie$j0t$1@fred.mathworks.com>...
> > "Priya " <priya.biomath@gmail.com> wrote in message <hjmvmc$kbd$1@fred.mathworks.com>...
> > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h$6tg$1@fred.mathworks.com>...
> > > > "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v$h9n$1@fred.mathworks.com>...
> > > > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v$hdp$1@fred.mathworks.com>...
> > > > > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> > > > > > > Anyone have idea how to do this in Matlab?
> > > > > >
> > > > > > try:
> > > > > > help ndgrid
> > > > > >
> > > > > > /Per
> > > > >
> > > > > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
> > > >
> > > > What about:
> > > >
> > > > xmin=0;xmax=1;Nx=10;
> > > > xvec=linspace(xmin,xmax,Nx);
> > > > yvec=xvec;zvec=5*xvec; %change here
> > > > [x,y,z] = ndgrid(xvec,yvec,zvec);
> > > > plot3(x(:),y(:),z(:),'.');axis equal;
> > > >
> > > > x(2,3,5)
> > >
> > > It looks nice but not like cylinder
> >
> > You said rectangular grid. A cylinder is a body with fixed cross-section elongated along ,lets say the z-direction. Do you want this cross section to be both a circle and rectangular? You have to approximate the circle into rectangles that fits within the radii then?
>
> what do you mean by "You have to approximate the circle into rectangles that fits within the radii then? "
> can you write me little more about such things.
n=20;
x=linspace(-1,1,n);
[X,Y]=meshgrid(x,x);
r0=1.01;
ix=find(X.^2+Y.^2<r0^2);
X=X(ix);Y=Y(ix);
plot(X(:),Y(:),'.');axis equal;
I'm not sure it help you. You need to know nearest neighbour index as well, right?
|
|
0
|
|
|
|
Reply
|
Per
|
1/26/2010 3:54:03 PM
|
|
"Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn$rab$1@fred.mathworks.com>...
> Anyone have idea how to do this in Matlab?
I need implementation like that on a bottom close cylinder
http://portal.acm.org/citation.cfm?id=1461512
Regards
|
|
0
|
|
|
|
Reply
|
mat001
|
3/24/2010 2:08:02 PM
|
|
n=20;
x=linspace(-1,1,n);
[X,Y,Z]=meshgrid(x,x,x);
r0=1.01;
ix=find(X.^2+Y.^2+Z.^2<r0^2);
X=X(ix);Y=2*Y(ix);Z=Z(ix);
plot3(X(:),Y(:),Z(:),'.');axis equal;
>> n=20;
x=linspace(-1,1,n);
[X,Y,Z]=meshgrid(x,x,x);
r0=1.01;
ix=find(X.^2+Y.^2+Z.^2<r0^2);
X=X(ix);Y=Y(ix);Z=2*Z(ix);
plot3(X(:),Y(:),Z(:),'.');axis equal;
not working !!
|
|
0
|
|
|
|
Reply
|
mat001
|
3/24/2010 2:19:05 PM
|
|
n=40;
x=linspace(-1,1,n);
[X,Y,Z]=meshgrid(x,x,x);
r0=1.0;
ix=find(X.^2+Y.^2<r0^2);
X=X(ix);Y=Y(ix);Z=2*Z(ix);
plot3(X(:),Y(:),Z(:),'.');axis equal;
I do not know this is really what i want.
|
|
0
|
|
|
|
Reply
|
mat001
|
3/24/2010 2:27:05 PM
|
|
"mat001 " <dres01@lycos.com> wrote in message <hod7fp$c0v$1@fred.mathworks.com>...
>
>
> n=40;
> x=linspace(-1,1,n);
> [X,Y,Z]=meshgrid(x,x,x);
> r0=1.0;
> ix=find(X.^2+Y.^2<r0^2);
> X=X(ix);Y=Y(ix);Z=2*Z(ix);
> plot3(X(:),Y(:),Z(:),'.');axis equal;
>
>
> I do not know this is really what i want.
|
|
0
|
|
|
|
Reply
|
mat001
|
5/28/2010 1:48:21 PM
|
|
|
11 Replies
303 Views
(page loaded in 0.077 seconds)
|