MATLAB: Finding values within a limit

MATLAB: Finding values within a limit

values below a limit

I have a couple of indices selected via t1=find(touse==1); Then I need to use it to find a few values that are below a particular value. But it gives a value which is above that margin as well. If my limit is 10.5 i used the following code
but it also gives a value above 10.5. Is there a mistake in that code?

Best Answer

  • I believe your error is in using the ‘t1’ result.
    Try this:
    test = 20*rand(20,1); % Create Data
    Result = test(test < 10.5); % Desired Output
    I have no idea how ‘test’ and ‘touse’ are related, so you will likely have to experiment to get the result you want.
  • Add a Comment

    Your email address will not be published. Required fields are marked *