Re: finding particular cell in cell array
- From: Nathan <ngreco32@xxxxxxxxx>
- Date: Tue, 7 Jul 2009 16:05:59 -0700 (PDT)
On Jul 7, 3:12 pm, "Wiater" <wia...@xxxxxxxxxxxxxx> wrote:
Hi everyone!
How to find a string value in cell array, and remove it?
I have a problem with cell array... I'm writing an aplication in GUI with 3
pop-up menus.
the 'string' values of the first pop-up menu is for example:
{'alfa ';'beta';'gamma';'delta';'omega'}
now, I'd like to choose one of the options (alfa, beta, gamma, delta, omega)
and automaticly remove it from the second pop-up menu. The same thing with
third pop-up menu.
e.g.:
1st popup menu:
{'alfa ';'beta';'gamma';'delta';'omega'}
choise: 'beta'
2nd popup menu:
{'alfa ';'gamma';'delta';'omega'}
choise: 'omega'
3rd popup menu:
{'alfa ';'gamma';'delta'}
I've been trying with something like that:
2ndarray=(1starray=='beta'); <--- the way I'd do it in case of simple array
of numbers... but it doesnt work with cell arrays
How about this:
tmpval = get(handles.listbox1,'Value');
tmpstr = get(handles.listbox1,'String');
tmpstr(tmpval,:) = [];
set(handles.listbox2,'String',tmpstr);
Is that what you are looking for?
This will delete the selected value from the "string", and send the
new string without that value to the next list box.
-Nathan
.
- Follow-Ups:
- Re: finding particular cell in cell array
- From: Wiater
- Re: finding particular cell in cell array
- From: Nathan
- Re: finding particular cell in cell array
- References:
- finding particular cell in cell array
- From: Wiater
- finding particular cell in cell array
- Prev by Date: Re: suppress warning messages
- Next by Date: Re: finding particular cell in cell array
- Previous by thread: finding particular cell in cell array
- Next by thread: Re: finding particular cell in cell array
- Index(es):
Relevant Pages
|