Selecting columns from an Excel file
33 ビュー (過去 30 日間)
古いコメントを表示
Shahar ben ezra
2020 年 12 月 15 日
コメント済み: Shahar ben ezra
2020 年 12 月 16 日
Hi
When I read an excel file by "readtable" I get the following file as an example
I am interested in getting the frequency range of 102-105 MHz only
How can I cut the file?
Thanks:)
** The original file contains a lot of columns so I am interested in entering the frequency range
0 件のコメント
採用された回答
Cris LaPierre
2020 年 12 月 16 日
編集済み: Cris LaPierre
2020 年 12 月 16 日
Use detectimportoptions and set the opts.SelectedVariableNames to be the variables (columns) you want to import. You can see several examples here. Here is another example from the readtable documenation page.
If your file contains a header row, those names can become the variable names. However, your specific request - having MATLAB figure out which columns to import by just entering a frequency range - is not native functionality. This is not to say you couldn't implement something, but it's on you to create the code to do that.
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!