Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
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

Date Subject Author
12/3/12 Javier
12/3/12 Nasser Abbasi
12/3/12 Javier
12/3/12 Javier
12/3/12 Nasser Abbasi
12/3/12 Javier
12/3/12 Nasser Abbasi
12/3/12 dpb
12/3/12 Javier
12/3/12 dpb
12/3/12 Steven Lord