How to set an upper and lower limit on a data set from a matrix
古いコメントを表示
I need to set an upper and lower limit on the numbers in a data set that belongs to a matrix.
How would I go about doing this?
2 件のコメント
James Tursa
2015 年 8 月 3 日
Please provide a short example showing inputs and desired output.
jgillis16
2015 年 8 月 3 日
採用された回答
その他の回答 (1 件)
James Tursa
2015 年 8 月 4 日
Assuming you want to extract all the rows where the 3rd column meets your conditions:
GalList = your matrix
lower_limit = 176.71;
upper_limit = 198.71;
x = (GalList(:,3) >= lower_limit) & (GalList(:,3) <= upper_limit);
extracted_rows = GalList(x,:);
3 件のコメント
jgillis16
2015 年 8 月 4 日
James Tursa
2015 年 8 月 4 日
Do you mean read in only those lines, or create a new file with only those lines, or what? How are you currently reading this file?
jgillis16
2015 年 8 月 4 日
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!