Output with specific critiria in data ?
古いコメントを表示
I am having a txt file with 4 columns. I would like to get a new file with spesific critiria, depending on the limits of values of 1st and 2nd columns. I would like my first column to have values ranging from a (minimum value) to b (maximum value). Also I would like my 2nd column to gave values ranging from c (minimum value) to d (maximum value). After that I want to get a file that would have all the rows that will have a<1st column values<b & c<2nd column values<d.
I am uploading a file as an example. (For example I would like to include values that:
2<1st column<18
30<2nd column<100)
Could you help me?
Thank you in advance
6 件のコメント
Rik
2021 年 2 月 8 日
What have you tried so far? This doesn't seem hard to achieve using logical indexing.
Ivan Mich
2021 年 2 月 8 日
Walter Roberson
2021 年 2 月 8 日
mask = a<first & first<b & c<second & second<d;
selected = big(mask,:);
writematrix(selected, 'OutputFile.txt', 'delimiter', '\t');
Ivan Mich
2021 年 2 月 20 日
Walter Roberson
2021 年 2 月 20 日
selected = [num2cell(d1(mask,:)), tex(mask,:)];
writecell(selected, 'OutputFile.xlsx');
Ivan Mich
2021 年 2 月 21 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Low-Level File I/O についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!