MATLAB: Load variable from mat file loadmat Hello, I have a mat file containing 4 variables. For some reasons, I would like to load only of these 4 variables (let's say Y). How can I load it without loading the 3 others ? Best Answer S = load('YourFileName', 'Y');Y = S.Y; Related SolutionsMATLAB: MAT files p=load matfile1.matq=load matfile2.matsave newmatfile.mat MATLAB: Load .mat file Try this:A = textscan(fid, '%s', 'Delimiter', ' ');impData = A{1}; %%This cell contains your dataimpData = impData (3:end); %%The data excluding the first two linesstrData = cellfun(@strsplit, impData, 'UniformOutput',0); %%Split data into two rowsnumData = cellfun(@str2double, strData, 'UniformOutput',0); %%Convert to numeric valuesmatData = cell2mat(numData); %%Convert into a matrix Related Question*.mat file does not appear in workspace.Load .mat fileIs there a way to save a .mat file with a variable as a filenameLoad multiple mat files
Best Answer