Effacer les filtres
Effacer les filtres

Elements in a vector

1 vue (au cours des 30 derniers jours)
Giuseppe Pintori
Giuseppe Pintori le 20 Sep 2019
Commenté : Stephen23 le 21 Sep 2019
Hi guys, I need your help.
I have a vector like the following:
rho = [0.8 : -0.01 : -0.8];
The problem is: for every simulation matlab should take in consideration the value of the vector; basically, for the first simulation should take rho = 0.8, for the second rho = 0.79 and so on.
I don't know what function is able to do something like that.
Moreover, I would like to create at the end of each simulation a folder called as the parameter and the value taken into consideration in that simulation (simulation 1, rho= 0.8, foldername rho_0.8); I've tried with the nextname function but I'm not able to use it in this situation.
Thanks in advance for any help.
  14 commentaires
Giuseppe Pintori
Giuseppe Pintori le 21 Sep 2019
Guys, at the moment I'm using this code in order to change the value of my parameter in every simulation:
rho = [0.8 : -0.01 : -0.8];
try
isempty(k)
catch
k = 0;
end
k = k+1;
var = rho(1,k);
Now, is there a way to create a folder named 'rho_ (value assumed by rho in the simulation)' for every simulation?
Stephen23
Stephen23 le 21 Sep 2019
"is there a way to create a folder named 'rho_ (value assumed by rho in the simulation)' for every simulation?"
Of course:
doc sprintf
doc fullfile
doc mkdir

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by