Need to initialize variables from a txt file
3 次查看(过去 30 天)
显示 更早的评论
I have successfully imported data from a txt file with the following command:
%Importing Txt file into MATLAB
T = readtable('fueldata.txt');
This code created a data table with 5 columns of variables, Var1, Var2, Var3, Var4, Var5. I need to intialize all these variable columns with specfic names. For a xlsx file, I usually just say something like "Speed = filename.Var1" but cannot do that in this instance I believe. Any help would be appreciated. Thank you in advance!
0 个评论
采纳的回答
Voss
2022-5-2
T = readtable('fueldata.txt','VariableNames',{'put' 'your' 'variable' 'names' 'here'});
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!