0
votes

I've a problem about how can I load a Landsat image on Matlab. My image is in format .img and have the following information:

Columns and rows= 9487 x 8543
Number of bands= 6
Cellsize= 25 x 25
Source Type= continuous
Píxel type= unsigned integer
Pixel Depth= 16 bit
Scale factor= 0,9996

And this is my code:

IM= multibandread('2000.img',[9487, 8543, 6],'int16',0,'ieee-le',{'Row','Range',[9487 8543]);

But there's the following error:

Error: Unbalanced or unexpected parenthesis or bracket.

I've tried to change but it doesn't work. What can I do?

Thanks in advance,

Emma

2
It appears you are missing a }Dennis Jaheruddin
Thanks for your reply Dennis, but it's still not working!user1578688
Not sure if this is a problem, but I see that you are using int16 rather than the unsigned variant uint16. If this does not solve it, perhaps you could upload the image?Dennis Jaheruddin

2 Answers

2
votes

Dennis is right, you're missing a closing curly brace. It should be inserted between the bracket and the parenthesis at the end like this:

IM= multibandread('2000.img',[9487, 8543, 6],'int16',0,'ieee-le',{'Row','Range',[9487 8543]});

0
votes

I think you may want to leave the subset argument out completely, this in addition to using unsigned uint16, try the following:

multibandread('2000.img',[9487, 8543, 6],'uint16',0,'ieee-le')

Note that with your current call it appears that you are trying to extract row 9487 to 8543.