MATLAB: Read number from file name leaving special characters filenamespecial characters data_3dsar_pass1_az001_HH.mat This is the filename. I need to read in the serial number at the end of the string. I have 360 such files starting from 001 to 360. how do i do it. Best Answer matfiles = dir('*.mat') ; % you are in the folder of mat files N = length(matfiles) ; % total number of files % loop for each file for i = 1:N thisfile = matfiles(i).name % do what you wantend Related SolutionsMATLAB: Leaving one out help % One of the many ways ...N = 10 ;for k = 1:N s = [1:k-1 k+1:N] % your code using send MATLAB: How to save a matrix that contains NaN, strings and numbers out={10 20 nan 'str' [1 2] [1 0;2 4]}You can save your data in a mat file:save filename out Related QuestionHow to save a .mat file and .py file automatically with a ‘variable’s’ value as filename using MATLABLeave the whole for-loop
Best Answer