How to use syntax T = readtable(filename) for creating a table from a file?
8 次查看(过去 30 天)
显示 更早的评论
I put the excel dataset file (.xlsx) with specific 'filename' in the Matlab projects saving path and then I used this syntax in command window
T = readtable(filename)
the program gives this error:
Undefined function or variable 'filename'
I'll be very grateful if suggest me a soloution
0 个评论
采纳的回答
Fangjun Jiang
2018-4-26
try this
filename='c:\MyDoc\MyFile.xlsx';
T=readtable(filename);
3 个评论
Fangjun Jiang
2018-4-27
I am not sure what do you mean saying "by using counters". Once the table is created, you can reference it by ".",e.g. T.Name, T.Age. See "help table". There is an example data, run the example and check out patients.Age, patients.LastName, etc.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!