Azzera filtri
Azzera filtri

How to change the variable name after each run

3 visualizzazioni (ultimi 30 giorni)
Hello everyone,
Let's say I have two variables SSD and GND. After I hit the run button for the first time, the program will run and give me the value of SSD1 and GND1. But after the 2nd run, it will give me SSD2 and GND2. After 3rd run, SSD3,GND3. And this will go on. How can I do that?

Risposte (1)

Steven Lord
Steven Lord il 16 Feb 2023
Can you dynamically create variables with numbered names like x1, x2, x3, etc.? Yes.
Should you do this? The general consensus is no. That Answers post explains why this is generally discouraged and offers several alternative approaches.

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by