Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Index exceeds matrix Dimensions?
Date: Tue, 27 Mar 2012 18:59:14 +0000 (UTC)
Organization: Mitre Corp
Lines: 22
Message-ID: <jkt2m2$76f$1@newscl01ah.mathworks.com>
References: <jkshid$42c$1@newscl01ah.mathworks.com> <jksubh$kth$1@newscl01ah.mathworks.com> <jkt1at$21a$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1332874754 7375 172.30.248.47 (27 Mar 2012 18:59:14 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 27 Mar 2012 18:59:14 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: news.mathworks.com comp.soft-sys.matlab:762357

"Sanaa" wrote in message <jkt1at$21a$1@newscl01ah.mathworks.com>...
> 
> Thanks a lot for your help. It really helped me. May I ask how did you fit the dimensions together?

Probably by inspection & years of experience.  You need to decide what is the actual dimension of ru.  266 or 600?

 I am new in Matlab. Another question if you please, did you mean that my code is not correct or what?

This link may help explain:
<<http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F>>

% You may want to change:
ru = (3.0/n):(3.0/n):4;
% to something like:
ru = round((3.0/n):(3.0/n):4);

doc round
doc ceil
doc fix
doc floor

> Thanks a lot in advance.