Clear Filters
Clear Filters

Image Help with loops

1 view (last 30 days)
PenguinForce
PenguinForce on 2 Oct 2016
Edited: PenguinForce on 2 Oct 2016
So I just realized that I misread the problem and was supposed to use loops to create the image values for every layer R, G and B. I have a working code but could someone please show me how I could get the same result while incorporating loops? Thank you so much!!

Accepted Answer

Image Analyst
Image Analyst on 2 Oct 2016
What do you mean misread? Is it homework? We're not supposed to just do your homework for you (so you don't get caught cheating), and if it's homework you're supposed to tag it as homework. Please read this http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers
So I assume you know how to do a for loop, so give it a try.
for col = 1 : 256
for row = 1 : 256
% Code for you to finish....
end
end
  2 Comments
PenguinForce
PenguinForce on 2 Oct 2016
This is not homework. I am trying to learn matlab on my own and I have purchased a book to help me. I am trying one ofthe problems in the book and I was trying to complete it but when I went back to read it again, I realized it said use a for loop and I was trying to rewrite my code using loops but I was struggling and beginning to give up which is why I decided to come here and ask for a way. I've been trying the for loop but it keeps giving me an error
PenguinForce
PenguinForce on 2 Oct 2016
But thank you for the help, your suggestion helped. I was forgetting to do a for loop within a for loop. Thank you for your help!

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!