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

  • SEARCH
  • Home
  • 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 5971933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:35:13+00:00 2026-05-22T20:35:13+00:00

I am trying to modify this code h = waitbar(0,’Please wait…’); for i=1:10, %

  • 0

I am trying to modify this code

h = waitbar(0,'Please wait...');

for i=1:10, % computation here %  waitbar(i/10) end
close(h)

How can I divide waitbar in 10 steps . I mean it should look like

-------------------
| | | | | | | | | |
-------------------
  • 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-05-22T20:35:13+00:00Added an answer on May 22, 2026 at 8:35 pm

    The following code will allow you to add vertical lines to your waitbar:

    hWait = waitbar(0,'Progress');  %# Create the waitbar and return its handle
    hAxes = get(hWait,'Children');  %# Get the axes object of the waitbar figure
    xLimit = get(hAxes,'XLim');     %# Get the x-axis limits
    yLimit = get(hAxes,'YLim');     %# Get the y-axis limits
    xData = repmat(linspace(xLimit(1),xLimit(2),11),2,1);  %# X data for lines
    yData = repmat(yLimit(:),1,11);                        %# Y data for lines
    hLine = line(xData,yData,'Parent',hAxes,...  %# Plot the lines on the axes...
                 'Color','k',...                 %#   ... in black...
                 'HandleVisibility','off');      %#   ... and hide the handles
    

    After running the above code and then doing waitbar(0.35,hWait);, you will see a figure like this:

    enter image description here

    NOTE: The black lines in the plot (both the vertical lines I added and the already existing box around the progress bar) will intermittently appear above or below the red progress bar when it is updated. This seems like an existing bug with how WAITBAR behaves, and I have yet to find a workaround to correct it. However, there are quite a number of alternatives that can be found on the MathWorks File Exchange, so I’d certainly check those out if the built-in function doesn’t do it for ya. 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify this code ( http://code.google.com/p/pypng/source/browse/trunk/code/texttopng ) so that it can render
I'm trying to modify this code in an attempt to make it work on
I'm currently trying to modify some HttpWebRequest functions, but I can't do it through
I'm trying to determine how to modify SAP R/3 package code of an installed
I grabbed this code form JCarousel and just trying to understand these lines below.
I'm trying to modify this bit of HTML with jQuery to delete the duplicate
I'm trying to modify the following code so that it will return a Dictionary<int,int>
I'm trying to modify some code that returns results from the database. Currently the
I am trying to modify an xml file from my aspx code. The file
You can view my custom slider here: http://www.awaismuzaffar.com/examples/index.html And below is the JQuery code

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.