Importing a two column array from excel
Mostra commenti meno recenti
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."
Risposte (1)
Rik
il 2 Ott 2020
1 voto
You forgot to put the quotes in your first call. That makes Matlab treat it like a variable, not a char array.
3 Commenti
Adam Salley
il 2 Ott 2020
Rik
il 2 Ott 2020
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
il 2 Ott 2020
T = readtable('chirp_data.xlsx');
Wanted = T{:, 2}
Categorie
Scopri di più su Spreadsheets in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!