Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!a39g2000pre.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: User defined length of pop-up menu GUI
Date: Thu, 20 Aug 2009 11:42:28 -0700 (PDT)
Organization: http://groups.google.com
Lines: 19
Message-ID: <e61a413d-df4e-4c88-8f97-cf4ff0919ada@a39g2000pre.googlegroups.com>
References: <h6k3ti$1a1$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.33
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1250793748 10977 127.0.0.1 (20 Aug 2009 18:42:28 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 20 Aug 2009 18:42:28 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: a39g2000pre.googlegroups.com; posting-host=198.206.219.33; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-Via: 1.1 wwwproxy-son-ca-01.ca.sandia.gov:80 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) 
	Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:564852

On Aug 20, 11:16 am, "Clay Ross" <clayton.e.r...@gmail.com> wrote:
> Hello.
>
> If I have an array of 1:n, how can I construct a pop-up menu with selections of 1:n? The user will be responsible for determining the value of "n." I just learned how to program GUI's in MATLAB today, so hopefully this isn't hard to do.
>
> Thanks!
>
> Clay

Put something like this in your edit-box callback (where the user
chooses n)
tmp = str2double(get(handles.edit,'string'));
set(handles.popupmenu,'string',1:tmp')


-Nathan