MATLAB Answers

Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than minValue. Ex: If minVal = 10, then dataSamples = [2, 12, 9, 20] becomes [4, 12, 18, 20].

29 views (last 30 days)
Alli Schwab
Alli Schwab on 1 Nov 2019
Answered: galaxy on 1 Nov 2019
Any help with this problem would be great!

  0 Comments

Sign in to comment.

Answers (1)

galaxy
galaxy on 1 Nov 2019
Let's try
minVal = 10;
dataSamples = [2, 12, 9, 20];
dataSamples(find(dataSamples <= minVal)) = dataSamples(find(dataSamples <= minVal)) * 2;

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by