From: "Steven_Lord" <>
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$>
References: <k9i87n$inl$>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1354573001 25986 (3 Dec 2012 22:16:41 GMT)
NNTP-Posting-Date: Mon, 3 Dec 2012 22:16:41 +0000 (UTC)
In-Reply-To: <k9i87n$inl$>
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: comp.soft-sys.matlab:784088

"Javier " <> wrote in message 
> 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
To contact Technical Support use the Contact Us link on