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$>
References: <jkshid$42c$> <jksubh$kth$> <jkt1at$21a$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1332874754 7375 (27 Mar 2012 18:59:14 GMT)
NNTP-Posting-Date: Tue, 27 Mar 2012 18:59:14 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: comp.soft-sys.matlab:762357

"Sanaa" wrote in message <jkt1at$21a$>...
> 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:

% 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.