Different variables depending on which file is loaded
Show older comments
Hi,
I have two text files named SIXRX1.txt and SIXRX2.txt, and both of them should be able to load into a script (but not simultaneously). So I want to be able to type load SIXRX1.txt OR load SIXRX2.txt at the top of my script. However, I need certain variables to change depending on which text file I load.
%If SIXRX2.txt is loaded, the variables should be
year1=1993;
year2=1998;
%And if SIXRX1.txt is loaded, the variables should be
year1=1999;
year2=2017;
How do I write this? Note: I plan on manually changing the number in the "Load SIXRX().txt" function, but I don't want to change the year variables aswell.
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!