if greater than in for loop
27 ビュー (過去 30 日間)
古いコメントを表示
using a for loop and if statement, i need to subtract 25 from each element in a vector called "seven" that is greater than 100.
here is my code, but when i run it i get the original values of all elements in seven. how can i fix this?
for k = seven
if k > 100
k - 25
else
k + 0
end
end
0 件のコメント
採用された回答
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!