Re-Bonjour!!
Voili j'ai ce code :
le problème c'est qu'en sorti j'ai ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 function listbox_csc_alea_Callback(hObject, eventdata, handles) % hObject handle to listbox_csc_alea (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns listbox_csc_alea contents as cell array % contents{get(hObject,'Value')} returns selected item from listbox_csc_alea global pl_list_file; disp(pl_list_file); tmp=get(handles.listbox_csc_alea,'Value'); list = get(handles.listbox_csc_alea,'String'); list_tmp(pl_list_file)=list(tmp); disp(list_tmp); pl_list_file=pl_list_file+1; set(handles.listbox_trier,'String',list_tmp);
Alors que je voudrais ça :1
'AME.CSC'
2
[] '8134869.CSC'
3
[] [] 'A2.CSC'
Donc vous avez tous vu1
'AME.CSC'
2
'AME.CSC' '8134869.CSC'
3
'AME.CSC' '8134869.CSC' 'A2.CSC'que le tableau 'list_tmp' se réinitialise à chaque affectation, donc MatLab doit re-déclarer à chaque clic sur la ListBox...comment contourner ce problème? Enfin plutot ou est ma faute?
![]()
Merki pour vos réponses
Partager