Sequence save of .dat files in matlab -


I try to save each stage results in sequence format. I.e. cm_clusters_2_00001.dat cm_clusters_2_00002.dat cm_clusters_2_00003.dat . "Particles_file_name" shows the required filename in the correct format, but when he saves that file, he writes "particles_file_name" and that is why I have my own results I am writing under the name of the name.

Part of the code that generates the sequence name:

  for KK = 1:20 (kk> <10) file_number = ['0000' int2str (kk) )]; Otherwise (kk> = 10 & amp; amp; amp; amp; amp; amp; amp; amp;; 1,0 & amp; nbsp; 100) file_number = ['000' int2str (kk)]; Ethef (K> = 100 & amp; amp; amp; amp; kk; lt; 1000) file_number = [ '00' int2str (kk)]; Athiff (KK> = 1000 & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; nbsp; amp; amp; nbsp; -0000) File_number = ['0' int2str (kk)]; End particle_file_name = ['cm_clusters_2_' file_number '.dat']; Save ('particles_file_name');   

Any body has suggested to me how to save these files so that it is written under its own name. As the code shows the correct name

  particles_file_name = ['cm_clusters_2_' file_number '.dat'];   

but save it wrong

You have to change:

  save ('particles_file_name')   

to

  (particle_file_name)   < P>  particle_file_name  with your variable, by renaming the file, you have to send it directly to the  save  command whatever you are typing string  'particles_file_name' , which has no variation with variable  particle_file_name .   

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -