Subscript indices must either be real positive integers or logicals in bsxfun
Show older comments
Hi there,
Had a look at various others posts that include this error message but cannot find what is missing from my code. Feel like I am brute forcing this by as it stands I have
T 19081 x 22 double % Raw Data values
StdTimedEdit 1 x 22 double % Standard Deviation values for each column
MeanTimedEdit 1 x 22 double % Means for each column
StDIndexFull 19081 x 22 logical % Logical Index for which values I want to run the bxs function on
I am trying to do run a bxsfun to replace values outside 2 standard deviations from the mean for each column with 'NaN', but only on the values that equal 1 in the logical StDIndexFull. Currently it looks as such:
T(bsxfun(@lt, T(T(StdIndexFull)), (MeanTimedEdit + 2*StDsTimedEdit)) ...
& bsxfun(@gt, T(T(StdIndexFull)), (MeanTimedEdit - 2*StDsTimedEdit)))= NaN;
This returns the following error:
Subscript indices must either be real positive integers or logicals.
Any assistance or opinions would be muchly appreciated
Matt
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!