
Re: Access to float coordinates in a 3D matrix
Posted:
Dec 3, 2012 8:47 AM


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

