MATLAB: Populate load_listbox with a particular file extension

file extensionlistbox

it has been a long day, and this last hang up is driving me nuts. i give up. can someone please point out the obvious? i have tried so many things that just dont work. below is cut and paste from the unadulterated code. please show me what i havent been able to do for an hour. say i have 3 files: 101.csv, 101.csv.bak, and 101.mat. how do i list only the .csv. thanks in advance.
function load_listbox(dir_path, handles)
cd (dir_path)
dir_struct = dir(dir_path);
[sorted_names,sorted_index] = sortrows({dir_struct.name}');
handles.file_names = sorted_names;
handles.is_dir = [dir_struct.isdir];
handles.sorted_index = sorted_index;
guidata(handles.figure1,handles)
set(handles.listbox1,'String',handles.file_names,...
'Value',1)
set(handles.text1,'String',pwd)
end

Best Answer

Replace
dir_struct = dir(dir_path);
with
dir_struct = dir(fullfilename(dir_path, '*.csv'));