MATLAB: How to save a .mat file and .py file automatically with a ‘variable’s’ value as filename using MATLAB MATLAB Eg: If I have a 'gradient'=20 and 'number' = 10. How to save a .mat file and .py file with a filename 20_10. Best Answer G = 20;N = 10;F = sprintf('%d_%d.mat',G,N);save(F,...) Related SolutionsMATLAB: Saving large files using uisave use uiputfile instead. Credit to Jan.[filename, filepath] = uiputfile('*.mat', 'Save the project file:');FileName = fullfile(filepath, filename);save(FileName, 'yourVariable', '-v7.3'); MATLAB: Imwrite filename Thank you Fangjun and Image Analyst. Your tip Fangjun point me to the answer.imwrite(X.cdata, [R{1}, '.png'])Regards,Diego Related QuestionHow to save specific workspace variables with UIPUTFILE in MATLABFilename parsingHow to save data in a file so after restarting the Matlab I will have the data stored in computerAutomatic filename savingIs there a way to save a .mat file with a variable as a filename
Best Answer