필터 지우기
필터 지우기

How to change the variable name after each run

조회 수: 3 (최근 30일)
MD MAHABUBUR ROHOMAN
MD MAHABUBUR ROHOMAN 2023년 2월 16일
답변: Steven Lord 2023년 2월 16일
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?

답변 (1개)

Steven Lord
Steven Lord 2023년 2월 16일
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.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by