MATLAB: Read text file and store in .mat file .txt to .mat I have a text file with these values: d030bcb1 6142d6ad 619b8312 618803cb 61866781 619c04c5 61c420b2 61ba1feb 61bec5b3 6221fe09 I want to read this text file and store in a .mat file. thanks in advance Best Answer fid = fopen('file1.txt');A= textscan(fid,'%s');fclose(fid);celldisp(A)save file2 A Related SolutionsMATLAB: I want to delete all the headerlines and delimiters from the data in the below attached text file The best solution is probably to read your entire file as text, then remove the header lines, then parse them with textscan. MATLAB: I wanna save string data in the gui with txt format but I want to choose directory and file name in dialog box [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 QuestionConcatenate data using fgetsTo read a text file using matlabImport data into a txt file from matlab
Best Answer