How to save the value of some variables in a .dat file inside a nested loop in the function environment
5 views (last 30 days)
I am trying to create a .dat file on each for loop of a function enviroment file. The code looks like:
% SAVE DATA HERE
So what I want to save has to be done where the warning "% SAVE DATA HERE" is placed in the code. I would like to save on each file the value of TIME, LX, LY, and MZ as column vectors, for each iteration on the for loop on j=1:length(Hy0) for all the i=1:length(Tmax0) iterations. It would be great if the name of my file could be controled showing the value of Tmax0(i) and Hy0(j) like... "Laser_Like_Hy0=,'value(Hy0(j))',_Tmax0=,'value(Tmax0(i))'.dat". It would be great if all the decimals of the above variables are saved. Again, just in case that it is important, this code is inside a function environment. I do not if cell2mat works there, for example.