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 ]
Nasser Abbasi

Posts: 5,647
Registered: 2/7/05
Re: Access to float coordinates in a 3D matrix
Posted: Dec 3, 2012 8:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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





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.