Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Access to float coordinates in a 3D matrix
Replies: 10   Last Post: Dec 3, 2012 5:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Javier

Posts: 61
Registered: 4/26/11
Re: Access to float coordinates in a 3D matrix
Posted: Dec 3, 2012 9:11 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Nasser M. Abbasi" wrote in message <k9iaid$518$1@speranza.aioe.org>...
> On 12/3/2012 7:31 AM, Javier wrote:
>

> >> you seem to be using the value itself as an index.
> >> use the location of the value as index. Not the value itself.
> >>

>
> > I use
> > x = x0 + t*dx
> > y = y0 + t*dy
> > z = z0 + t*dz
> > with t: 0:0.1:1, and d the direction vector.
> > This is the value of the coordinate isn't it?
> >

>
> when you say `This is the value of the coordinate isn't it`,
> to which `This` are you refering to?
>
> any way, when you write
>
> t: 0:0.1:1;
> x0=1; dx=0.1;
> x = x0 + t*dx
>
> then use x(1) or x(5) to access values in the
> x vector. do not use x(0.01) or x(0.5).
>
> You loop index will be something like
>
> for i=1:length(x)
> x(i) = .....
> end
>
> --Nasser
>

This are the first values for x: x(1),x(2) and x(3): 3,54551732809566 3,63234837121917 3,71917941434267 3.

They are floating points because I have a decimal resolution. If for example I want to acces Structures (x(1),y(1),z(1)), I can't.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.