Results 1 to 2 of 2

Math Help - help with MATLAB questdlg loop

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    2

    help with MATLAB questdlg loop

    Hi,

    I wrote a function that draws regions on an image, now I'm really stuck on creating a loop out of the message box that appears, asking if the user wants to draw another one, redo the previous or stop drawing.

    Here is the basic framework of the relevant bit:

    i=1
    %insert function stuff

    button=questdlg('Add region?',...
    'Add',...
    'Yes','Redo prev','No','Yes');


    while strcmp(button,'Yes')
    i=i+1
    %stuff

    button=questdlg('Add region?',...
    'Add',...
    'Yes','Redo prev','No','Yes');
    end


    while strcmp(button,'Redo prev')
    %stuff, overwrites current i

    button=questdlg('Add region?',...
    'Add',...
    'Yes','Redo prev','No','Yes');
    end


    while strcmp(button,'No')
    %stops
    end
    I don't think it can go back to the first while 'Yes' after the 'Redo Prev' while. Is there a better way to do this?

    Thanks for reading...and any pointers at all would be a great help..
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Mar 2010
    Posts
    2
    Err problem solved, mods can delete this thread.

    :S
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab question! Help! Infinite loop.
    Posted in the Math Software Forum
    Replies: 3
    Last Post: June 30th 2010, 02:07 AM
  2. Matlab while loop, Please help!
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 23rd 2010, 01:14 AM
  3. Creating a loop in Matlab help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 11th 2010, 03:06 AM
  4. Matlab While Loop Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 8th 2009, 07:50 PM
  5. Matlab loop help
    Posted in the Math Software Forum
    Replies: 2
    Last Post: July 20th 2008, 10:47 AM

Search Tags


/mathhelpforum @mathhelpforum