Re: finding particular cell in cell array



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
.



Relevant Pages

  • Re: PopUp Window from Codebehind
    ... It's not a popup if the user clicked it, ... > Why does my code for a pop-up window from my app not get blocked by IE SP2 ... > (No exceptions have been made in IE's Pop-up blocker settings either) ... > Private Function openNewWindow(ByVal url As String, ...
    (microsoft.public.dotnet.framework.aspnet)
  • finding particular cell in cell array
    ... How to find a string value in cell array, ... I'm writing an aplication in GUI with 3 pop-up menus. ... 1st popup menu: ...
    (comp.soft-sys.matlab)
  • Re: Send email with optional message from combo box?
    ... i understand hot wo esetup a rowsource for a combo, ... I meant how would i go about getting the combo to pop-up?. ... Dim SendTo As String, MySubject As String, MyMessage As String ...
    (microsoft.public.access.formscoding)
  • Re: gui - appending text
    ... 'Hello' in a newline in txtBox. ... when you setthe String ... property of a text box or edit box with a char array that has a newline ... Another poster suggested using cell array of strings instead. ...
    (comp.soft-sys.matlab)
  • Re: How to reference and populate controls on Content Page
    ... Calendar page does not use masterpage. ... Only the page that calls popup does. ... I have very little code in the page that calls the calendar popup. ... string strDate = calDate.SelectedDate.ToShortDateString; ...
    (microsoft.public.dotnet.framework.aspnet)