Need help using the for loop
    5 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    

Test case
Check if AdjustMinValue(4, [2, 12, 9, 20], 10) returns [4, 12, 18, 20]
0 commentaires
Réponses (1)
  David Hill
      
      
 le 22 Oct 2019
        Not sure why you have to use a for-loop.
function dataSamples = adjustMinValue(dataSamples,minValue)
for i=1:length(dataSamples)
    if dataSamples(i)<minValue
        dataSamples(i)=2*dataSamples(i);
    end
end
2 commentaires
Voir également
Catégories
				En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

