>> > 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? >> > ...
> 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.
Well, no, you can't. At the command line...from your values
Note that x is a row vector of 10 elements. You can't have indices that aren't integers--what would the 3.5542...th entry in x be? The question makes no sense posed that way.
What, specifically, are you trying to do that you're trying to write x(a_x_value) instead of x(an_index_value)?
If you're trying to locate where within the array a particular value is located, you can use find() or logical addressing (subject to the caveats that equality-testing for floating point is subject to precision problems so that you may not find the result if do exact comparisons).
At the command line again...
>> ix=find(t==0.3) ix = 
Note above returned ...what's up w/ that? Let's see...
>> t(4)-0.3 ans = 5.5511e-017
Ah, note the small discrepancy between the value of approximately 0.3 that you obtained from the floating point construction used to build the t vector and that which was converted to internal representation when typed in '0.3' at the command line...this is normal and one has to be sure to deal with it when using floating point.
So, let's try something else...
>> ix=find(abs(t-0.3)<1E-6) ix = 4 >> x(ix) ans = 3.5716 >>
Hopefully that will clarify the problem you're having. The lesson to learn is
A) There _can't_ be anything but an integer array index
B) Floating point comparisons aren't exact
Again, clarify what you're _really_ trying to do that causes you to write what you've written...