MATLAB: How to read and save different variables in a matfile to another mat file MATLAB How to read two specific variables from a .mat file having different variables and save it to another .mat file without changing the variable name. Best Answer S = load('file1.mat','var1','var2');save('file2.mat','-struct','S')ORS = load('file1.mat');save('file2.mat','-struct','S','var1','var2') Related SolutionsMATLAB: MAT files p=load matfile1.matq=load matfile2.matsave newmatfile.mat MATLAB: Syntax to store char in mat file var_name='c' % saves the char 'c' in var_namesave('new.mat','var_name') % saves the variable 'var_name' in new.mat file Related QuestionHow to save variable value neatlyProblems with saving and loading inside functionsHi all :how to save some new variables to different mat file
Best Answer