Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how to do it...
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an excel sheet.. it reads huge data eg: 1647 *20. I used load function to extract 1st & 5th column. But still i wann some function to restict it so that it reads the data from the corresponding column upto 10/certain limit but not all... Like 1 column is time: showing time from 1 till 162 secs.. similarly 5 th column showing pressure from some random data... I want to read 1st 10 time & 1st ten pressure data from my excel sheet.
댓글 수: 0
답변 (3개)
Image Analyst
2013년 11월 6일
That is not huge - far, far from it. You can pass in the range you want to read into xlsread(), so just pass in a smaller range. If you don't know the range until you've read it in, then read in a little bit more than you think you'd need and check. Otherwise you can use ActiveX to pull over one cell at a time and check it, but honestly I don't believe that will give you any noticeable speed up over just reading the whole thing in and checking it in MATLAB. Or you could read in the whole time column, then check it to see how many rows you need, then read in that many rows from column 5. If you did that, you should use ActiveX because it you used xlsread() to do that, it involves launching Excel twice and shutting it down twice, which is time consuming.
If you're interested, I've attached an ActiveX demo below.
댓글 수: 0
David Sanchez
2013년 11월 6일
Option 1:
my_data_time = xlsread('your_excell.xls','A1:A10'); % first column
my_data_pressure = xlsread('your_excell.xls','E1:E10'); % fifth column
Option 2:
all_data = xlsread('your_excell.xls');
my_data = all_data(1:10,[1,5]);
% you'll end up with a matrix whose first column is time and second column is pressure
댓글 수: 2
ES
2013년 11월 7일
Those are not headers.. 'A1:A10' is a cell range of 10 cells starting A1 to A10.
my_data_time = xlsread('your_excell.xls','A1:A10'); % first column
this particular line will read first 10 rows of the first column of your excel file. Excel file has this row information with it. These are not any typed headers or so.
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!