MATLAB: How to use regexp to split the filepath regexp file path= C:\Data\Project\PCOD\PCOD_Model.mdl I want the model path only like C:\Data\Project\PCOD\…. how can I do it Best Answer Use the fileparts() function, not regexp():[folder, baseFileName, extension] = fileparts(yourFilePath); Related SolutionsMATLAB: Create folders using matlab Use this:mkdir(['folderA/folderB/folderC/folderD/folderE']);folderA could also contain a drive, like 'D:\myFolder'. MATLAB: Regexp split at first whitespace You may use the once option to split only once at the first occurrence of whitespace. splitcells = regexp(data,'\s','split','once') Related QuestionCall cplex from matlabUse regexp to split table columnsRegexp qwestionHow to select the first letter of every wordRegexp helpHow to remove top phrases from a word cloudProblem with regexp and split, and picking some cells
Best Answer