Asked by Giuseppe Pintori
on 20 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.

Opportunities for recent engineering grads.

Apply Today
## 14 Comments

## Walter Roberson (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_747985

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_747993

## Stephen Cobeldick (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_747997

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748003

## Stephen Cobeldick (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748007

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748016

## Stephen Cobeldick (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748026

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748038

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748112

## Stephen Cobeldick (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748114

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748117

## Walter Roberson (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748236

## Giuseppe Pintori (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748459

## Stephen Cobeldick (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481283-elements-in-a-vector#comment_748476

Sign in to comment.