フィルターのクリア

'Find' function doesn't get me all required values

10 ビュー (過去 30 日間)
Bianca Elena Ivanof
Bianca Elena Ivanof 2016 年 4 月 28 日
コメント済み: Star Strider 2016 年 4 月 30 日
Hello,
I am trying to use the 'find' function in order to locate some data-points that I need to exclude (erase all (:,25)>100)
It works, in that I get back 5 rows in column 25 that are indeed problematic - yet, I've found an additional one, bigger than 100, that 'find' doesn't seem to... find (the problematic :,25 I've found by merely scrolling down the matrix is not among the aforementioned 5 rows MATLAB finds).
I can't seem to get my head around what the problem is so could you please help me with any ideas?
  4 件のコメント
Image Analyst
Image Analyst 2016 年 4 月 28 日
編集済み: Image Analyst 2016 年 4 月 28 日
AGAIN, what is your array? Bianca, we don't have your all_operant_data, so how can we help? Type this on the command line and then paste the result back here:
probability_judgment
and also tell us the exact row numbers that you think find() should return.
Bianca Elena Ivanof
Bianca Elena Ivanof 2016 年 4 月 28 日
You'll find find probability_judgment.mat attached - I preferred to attach it rather than copying and pasting it as a code because there are 7800 rows.
The problem is that I don't know how many data-points>100 I should find - I only know there aren't many experimenter mistakes, there shouldn't be many values>100.

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

採用された回答

Star Strider
Star Strider 2016 年 4 月 28 日
編集済み: Star Strider 2016 年 4 月 28 日
We would have to see your code, your matrix, and a bit more detail as to what you want to do. ‘Logical indexing’ rather than using find (unless you need the actual index numbers) might be easier.
EDIT (15:35 GMT, 2013 04 28)
When I run this:
D = load('Bianca Elena Ivanof probability_judgment.mat');
M = D.probability_judgment;
GT100 = sum(M > 100)
GE100 = sum(M >= 100)
I get:
GT100 =
5
GE100 =
256
The 5 values that seem to meet your criterion are:
111
660
7030
1575
4020
Which one isn’t on this list? I’ve not seen any evidence that MATLAB’s comparison functions are inaccurate. I doubt that floating-point approximation error could account for the discrepancy you see. Use format short g to look at your vector.
  12 件のコメント
Bianca Elena Ivanof
Bianca Elena Ivanof 2016 年 4 月 30 日
Hello Steven and Star Strider
Many thanks for your explanations and support - it's dawned on me. OF COURSE that, by applying my initial method, upon deleting the first faulty row (out of 5), the matrix contains one row less. Therefore, if I delete the remaining 4 rows serially (as I did), I will delete the wrong rows (because there will be n-4, n-3, n-2, n-1 rows and the matrix changes linearly with the number of rows I delete).
Thanks!
Star Strider
Star Strider 2016 年 4 月 30 日
Our collective pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by