Importing a two column array from excel
古いコメントを表示
I'm trying to import an excel file, read data from the file into my code. I've tried the import data tool and it opend the data in a new tab. I don't know how to tell my program to read the program from that new tab that is call Variables-chirpdata. When I run the program, it also deletes all the data in the Variables-Chirpdata tab.
I've also tried all of these ways
T = readtable(chirp_data.xlsx)
numData = xlsread('chirp_data.xlsx')
switchpos = numData(:;2);
to call it directly from the file i keep getting error messages of "Unable to resolve the name chirp_data.xlsx." or "Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters."
回答 (1 件)
Rik
2020 年 10 月 2 日
1 投票
You forgot to put the quotes in your first call. That makes Matlab treat it like a variable, not a char array.
3 件のコメント
Adam Salley
2020 年 10 月 2 日
Rik
2020 年 10 月 2 日
If you don't actually want a table I would suggest checking if one of the three outputs of xlsread do what you want. Otherwise you can use the normal syntax for tables to manipulate your data. I'm on mobile and I don't work with tables, so I can't easily give you an example.
madhan ravi
2020 年 10 月 2 日
T = readtable('chirp_data.xlsx');
Wanted = T{:, 2}
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!