How to read a single column for specific data?

Hi,
How can I read this column just for specific data?
x=[1;2;3;4;5;6;7;8;9;10];
I just want to read 1,2,3 and 9, 10 and calculate some formula just for these data.
Could you please guide me how?

 採用された回答

Walter Roberson
Walter Roberson 2012 年 12 月 31 日

1 投票

How do you know which data you want to "read"? Is it the 1st, 2nd, 3rd, 9th and 10th positions? If so then
x([1 2 3 9 10])

5 件のコメント

Ara
Ara 2012 年 12 月 31 日
編集済み: Ara 2012 年 12 月 31 日
When Matlab read the excel file one column is for time which start from 0-24h so I want to plot just for daytime so I need Matlab NOT read the time between 10 am-22 pm. "time"
data=xlsread('1613_0.xls'); % read data %"1613_dow.xls"
dow = 0; % input dow
data_filter=find(data(:,25)>60); % filter data difilter for L2 locktime more than 240
data_filtered=data(data_filter,:); %
t=data_filtered(:,2);
time=(t./3600)-(24*dow); %convert to time UT
Walter Roberson
Walter Roberson 2012 年 12 月 31 日
Oh. A duplicate question.
Ara
Ara 2012 年 12 月 31 日
Sorry, if I shouldn't have asked. My question is for integer number in one single column how to identify to read like 10<time<22? should I write a loop?
Walter Roberson
Walter Roberson 2012 年 12 月 31 日
data(data(:,1) < 10 | data(:,1) >= 22, :)
Ara
Ara 2012 年 12 月 31 日
Thank you, walter. Happy New Year!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePsychology についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by