フィルターのクリア

triple "and" condition

5 ビュー (過去 30 日間)
sani
sani 2020 年 10 月 27 日
コメント済み: Walter Roberson 2020 年 10 月 27 日
Hello,
I have a script that part of it is checking that the values of the table line are in the region of interest and then save it to other arrays.
When I added a 3rd condition (marked in underline) to the if function, I started to get error messege (not detailing what's wrong).
this is the script:
for i=2:length(Ge_find)
if ( (coince_table.time_stamp(Ge_find(i)) - coince_table.time_stamp(Ge_find(i)-1)) >= coince_win_LL ...
&& (coince_table.time_stamp(Ge_find(i)) - coince_table.time_stamp(Ge_find(i)-1)) <=coincesh_win_UL)...
&& (coince_table.detector((Ge_find(i)-1)) == 0)
Delta(r) = (coince_table.time_stamp(Ge_find(i)) - coince_table.time_stamp(Ge_find(i)-1));
Ge_energy(r)= coince_table.energy(Ge_find(i));
scint_energy(r) = coince_table.energy(Ge_find(i)-1);
Ge_timestamp (r) = coince_table.time_stamp(i);
scint_timestamp (r) = coince_table.time_stamp(Ge_find(i)-1);
row = Ge_find(i);
r = r+1;
end
end
How can I add this condition?
P.s I also tryed this:
if and( (coince_table.time_stamp(Ge_find(i)) - coince_table.time_stamp(Ge_find(i)-1)) >= coince_win_LL ...
&& coince_table.time_stamp(Ge_find(i)) - coince_table.time_stamp(Ge_find(i)-1)) <=coincesh_win_UL, (coince_table.detector((Ge_find(i)-1)) == 0)
But it didn't work.
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 10 月 27 日
We do not know the size of the variables, so it is difficult to say.
By the way, I suggest
for i=2:length(Ge_find)
tsdiff = coince_table.time_stamp(Ge_find(i)) - coince_table.time_stamp(Ge_find(i)-1);
if tsdiff >= coince_win_LL && ...
tsdiff <= coincesh_win_UL && ...
coince_table.detector((Ge_find(i)-1)) == 0
stuff
end
end

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by