On May 26, 12:56 pm, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> "Sepehr Sadighpour" <sepehr...@gmail.com> wrote in message <hthql9$da...@fred.mathworks.com>...
>
> > I figured because H is in 0.05 increments starting at 0.05 and going to 0.95, multiplying it by 20 would yield integers that could work as indices for the third dimension of fbm100. Any light you can shed on this would be really appreciated.
> > .....
>
> That's where you made your mistake! With floating point numbers on any binary machine, they cannot represent .05 exactly, so that upon multiplication by 20, they don't always yield an exact integer. You need to alter your program to use integer indices directly and work out the fractional quantities from those indices.
>
> Roger Stafford
As well as that, I think you've got the first two indexes arse about
face.
Shouldn't it be:
fbm100(n,:,H*20) =
not
fbm100(:,n,H*20) =
And the best way to fix the other problem is to replace
for H = Hstart:Hinc:Hend;
with
for ih=1:Hsize
then
fbm100(:,n,ih)=wfbm(H(ih),lg);
