Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: index exceeds matrix dimensions.
Replies: 1   Last Post: Nov 11, 2012 2:26 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kyp

Posts: 1
Registered: 11/11/12
index exceeds matrix dimensions.
Posted: Nov 11, 2012 8:40 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am trying to implement the RGB function, that basically when i press the red button, the picture will getting red...when i press the green button, the picture will getting green etc.

Here is the quote:


switch color

case 1, %zero the GB

pic(:,:,1)=pic(:,:,1);

pic(:,:,2)=pic(:,:,2).*0;

pic(:,:,3)=pic(:,:,3).*0;

case 2, %zero the RB

pic(:,:,2)=pic(:,:,2);

pic(:,:,1)=pic(:,:,1).*0;

pic(:,:,3)=pic(:,:,3).*0;

case 3, %zero the RG

pic(:,:,3)=pic(:,:,3);

pic(:,:,1)=pic(:,:,1).*0;

pic(:,:,2)=pic(:,:,2).*0;

otherwise

disp(['error']);

end

when i compiled the program i am getting the error:

Index exceeds matrix dimensions.

Error in func_rgb (line 16)

pic(:,:,2)=pic(:,:,2).*0;

The problem is with the .tif images, because with the .jpg images the program is running! Do you have any idea how to solve it ?

Thank you!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.