readtable in matlab2020 vs readtable in matlab2018
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
So, I used matlab2020 to make m file. I used readtable function. As stated in documentation starting in R2020a, the readtable function read an input file and ignores headers.
PV_Power_TABLE=readtable('PV_Power.xlsx','Range','C6:CT6');
But my friend is using matlab2018 and and headers exist in his table, and code is not working, because matlab2018 is getting data with headers. How can I change this line, to make code work in matlab2018. So I need matlab2018 to ignore headers as well as 2020. What readtable option should I use ?
0 Commenti
Risposte (2)
Cris LaPierre
il 19 Dic 2020
Modificato: Cris LaPierre
il 19 Dic 2020
We can't really help you with specifics unless you share the file, as well as specify if it is R2018a or b.
With every release, readtable gets better and better at autodetecting the file format. In an older release, you will need to specify more of the import settings.
You could also have your friend use the import tool to interactively load the data, and then generate a script. You could borrow the settings from the script to determine what settings to add to your import code.
0 Commenti
Walter Roberson
il 20 Dic 2020
readtable does not ignore headers when used with those options.
Current versions of readtable use detectImportOptions automatically unless told not to. With older versions of MATLAB you can call detectImportOptions yourself.
When you use the Range option the difference between between using detectImportOptions or not is that when detectImportOptions is used then MATLAB does a better job of figuring out what Variable Name to use.
0 Commenti
Vedere anche
Categorie
Scopri di più su Workspace Variables and MAT Files in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!