Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7799789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:25:18+00:00 2026-06-02T00:25:18+00:00

I have an image (5×5)pixels with 3 values which value 0, 128, and 255.

  • 0

I have an image (5×5)pixels with 3 values which value 0, 128, and 255.

I want to check the pixels of the index (1,1) to (1,5).

If there is pixel value 0 (black), then the pixels of the index (1,1) to (1,5) is changed to 128 (gray), if none, then the pixels are changed to 255 (white).

I want to do these steps again, checking of the index (2,1) to (2,5), (3,1) to (3,5), through to the bottom.

from the above problems, I get a solution like this:

mask = repmat(any(I == 0,2),5,1);

I(mask) = 128;

I(~mask) = 255;

but if I want to check pixels vertically, from the index (1,1) to (5,1), then to the right, the index (1,2) to (5,2), until the end.
what’s the solution?

Thank You

Regards, Wahyu

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:25:19+00:00Added an answer on June 2, 2026 at 12:25 am

    You could just transpose your matrix/image, use the solution you were given in your previous question and then transpose again to get back to the original matrix/image:

    I = I';
    %# Do solution you got last time here
    %#{
    
    %#}
    
    I = I';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have image upload, where I check, how big part of image is already
So I have Image like this (source: de-viz.ru ) I want to get something
So I have Image like this (source: de-viz.ru ) I want to get something
I have Image which belongsTo User, and I have Coupon which belongsTo User. Each
I have image with some object at not solid background. I want to extract
I have image files in a directory which have downloaded from several resources. If
I have image which size was 600 * 600 and it was displayed on
I want to have image button for browse and upload I have textbox using
I have image file which is 6k jpg file with width: 172px and hight:
I have image control.I want to load image from my specific path. i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.