MATLAB: I wanna save string data in the gui with txt format but I want to choose directory and file name in dialog box gui for example; string=[100, 150, 200] I want to save this data with .txt format in dialog box which enables me to choose directory and file name like uiputfile. Best Answer [file_name PathName] = uigetfile('*.mat','Select *.mat file');full_file_path = fullfile(PathName, file_name);fid = fopen('my_txt_file.txt','w'); % open file for writtingfwrite(fid,full_file_path);fclose(fid); Related SolutionsMATLAB: A question about function — uigetfile() Hi.. Try this code:[filename, pathname] = uigetfile({'*.xlsx','Excel Files(*.xlsx)'; '*.txt','Txt Files(*.txt)'}, 'Pick a file');I think it's only missing the {}; MATLAB: How to take input as excel file from user in matlab? [filename, pathname] = uigetfile({'*.xls', '*.xlsx'}, 'Pick an excel file');fullname = fullfile(pathname, filename);[num, txt, raw] = xlsread(fullname); Related QuestionHow to load .dat (or even .txt ) files into matlab workspaceOpen file in notepad via guiHow to select a text file from a directory and read it in GUI matlabDatatype after using load in GUIDE
Best Answer