Supa
Supa

Reputation: 145

Fix for this array? It's plotting a bunch of zeros somewhere

For some reason it's plotting red area in the figure. I'm only worried about the island that is being colored.

http://img528.imageshack.us/img528/506/2bc9e702042a46369c7631b.png

Upvotes: 1

Views: 51

Answers (1)

dinkelk
dinkelk

Reputation: 2786

Your allocation of of dayh99 looks like this:

dayh99 = zeros(length(fname),610,620);

And then you try to fill it with values that are out side of that range in your loop.

dayh99(i,240:850, 130:750) = ...

I think you want to begin filling at index 0 in both dimensions. This will eliminate the "red" areas in your plot.

Try this in your loop to fill dayh00:

dayh99(i,:,:) = tmp(240:850,130:750);

Upvotes: 1

Related Questions