Path: news.mathworks.com!not-for-mail
From: "Steven_Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Access to float coordinates in a 3D matrix
Date: Mon, 3 Dec 2012 17:16:40 -0500
Organization: MathWorks
Lines: 23
Message-ID: <k9j8c9$pc2$1@newscl01ah.mathworks.com>
References: <k9i87n$inl$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1354573001 25986 172.28.9.169 (3 Dec 2012 22:16:41 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 3 Dec 2012 22:16:41 +0000 (UTC)
In-Reply-To: <k9i87n$inl$1@newscl01ah.mathworks.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: news.mathworks.com comp.soft-sys.matlab:784088



"Javier " <javsanzperez@gmail.com> wrote in message 
news:k9i87n$inl$1@newscl01ah.mathworks.com...
> Hi, I have several 3D lines to analyze a structure. The problem is that 
> these coordinates aren't integer, for example 1.9 and I have the error:
> Subscript indices must either be real positive integers or logicals.
>
> I don't want to ceil, floor or round, cause if I do this the lines are 
> modified, how could I access to these coordinates without changing the 
> line?

There's no such thing as the 1.9th element of a matrix in MATLAB. You will 
need to either locate the element "closest to" your desired element (for 
some definition of "closest to") or perhaps interpolate between the 1st 
element and the 2nd element.

-- 
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com