Matrix manipulation Specific rows and columns
3 ビュー (過去 30 日間)
古いコメントを表示
I have a huge set of data in an excel spread sheet it is 16 columns A-P and 4800 rows.I need to take the data from column F and H and find where each of them is greater than 10 in the same row. and then sore this information in a variable.
So say I have the 16 columns, I want the 6th column and the 8th column. Once I call those out, I want to find where they each are greater than 10. Once I know where they are greater 10, I need to know where both are greater then ten in the same row. Like row 2000 column F and column H are greater then ten. Once I have the total number that is greater then ten in the same row I then will store them in a variable. Thank You so much.
0 件のコメント
回答 (1 件)
Jos (10584)
2018 年 9 月 27 日
First you need to read in the excel into a regular matlab array. Then use logical indexing to select your data. An example:
DATA = randi(10,10,8) % a small example
tf = DATA(:,3)>5 & DATA(:,6)>5 % where are the values in column 3 and 6 larger than 5
OUT = DATA(tf,[3 6]) % select those values from these columns
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!