How to extract specific columns from large excel spreadsheet

I am doing a project for school, and I'm very new to MATLAB. I have only just learned how to use xlsread to import an excel spreadsheet. I have an excel spreadsheet with a little over 300 rows and 15 columns. I need to be able to extract specific rows from specific columns. For example to create a scatter plot I need to extract about 100 different rows (not in order) from 2 of the columns. What is the best way to go about this? Thank you.

1 件のコメント

Arif Hoq
Arif Hoq 2022 年 3 月 17 日
use readtable function. can you please be specific which rows do you want to extract ? Please attach your data

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2022 年 3 月 17 日

0 投票

With xlsread() you can specify what columns in the cell reference, something like
[numbers, strings, raw] = xlsread(filename, 'Sheet2', 'C1:D100'); % Extract column C & D
Adapt as needed.

2 件のコメント

Alexander Duncan
Alexander Duncan 2022 年 4 月 6 日
Can this be used to extract certain rows from those columns?
Image Analyst
Image Analyst 2022 年 4 月 6 日
If you wanted certain rows, you could extract it from numbers, strings, or raw with indexing, as usual, or you could just alter your range in the call to xlsread, like 'C30:D50' or whatever you want.

サインインしてコメントする。

製品

タグ

質問済み:

2022 年 3 月 17 日

コメント済み:

2022 年 4 月 6 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by