Hi all, I am sure this will be easy for one of you clever people but it has got me stumped.(adsbygoogle = window.adsbygoogle || []).push({});

I am working on a physics project and I am using MATLAB to acquire some data.

So basically I have a time varying current signal coming in and I am collecting the current data and plotting it against time. Now I want to do this several times using a for loop. I need to keep the data acquired with each loop and be able to use each set separately.

i.e. current = data_in

My problem is how do stop it from overwriting the current vector next time it loops?

Ideally I would like it to save the vectors in the following way:

current_1 = x x x x x x x x x x x x x x

(loop again)

current_2 = x x x x x x x x x x x x x x

(loop again)

current_3 = x x x x x x x x x x x x x x

and so on...

So is there a way I can change the current variable name each time the loop goes round.

Sorry if this seems a little confusing, I am confused myself.

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB - changing variable name with each iteration?

Loading...

Similar Threads for MATLAB changing variable | Date |
---|---|

Matlab -- how can i use a FOR loop if I have 2 variables changing | Oct 12, 2016 |

[Matlab] dynamic change in formatting crop not showing | Nov 11, 2014 |

Matlab - Change parameters of equation while plot displayed | Jun 16, 2014 |

MATLAB help for modelling with changing variables. | May 31, 2012 |

MATLAB Matlab for Loop of two changing variables | May 1, 2012 |

**Physics Forums - The Fusion of Science and Community**