WHY LOGICAL INDEXING REDUCE TOTAL ROW COUNT
显示 更早的评论
Dear MATLAB,
I notice strange thing happen when use logical indexing. Specifically, the number of row is reduced.
Is this a bug? I am using MATLAB2017a
Thanks in advance for any insight.
The code are as follow
load('help_ismember'); % attached together with this question
NonNanPVT_Logic=ismember(Validtn_Loc,Validtn_Loc_MIA); % 37 row
KSS_valid_WithNan(NonNanPVT_Logic==0)=ev.KSS_valid(NonNanPVT_Logic==0); %Output reduced to 36
2 个评论
Stephen23
2019-3-8
"Is this a bug?"
Not really, This behavior is easy to demonstrate:
>> X = [true,true,false,false];
>> A(X) = 3
A =
3 3
What size would you expect A to be?
polo sepian
2019-3-14
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!