Different variables depending on which file is loaded
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!