MATLAB: How can i save values in a seperate file.I want to save the resultant matrix in a seperate file after manupilation

matrixsave

after calculating certain variables n times.i want to save value in a seperate folder

Best Answer

Hello, you may refer the following code, where I am running a loop to generate random matrix of specified size (10X10 here) and saving it into mat files. You can follow the analogy to save into any format.
clc; clear all
N = 10 ; % any number number
for i = 1:N % loop
A = rand(10,10) ; % A random matrix
filename = strcat('A',num2str(i),'.mat') ; % filename A1.mat, A2.mat etc
save(filename,'A') % save into different files
end