how do I substitute the values inside the vector?
1 回表示 (過去 30 日間)
古いコメントを表示
If you have a vector x = [1.92 , 0.05 , -2.43 , -0.02, 0.09, 0.85 , 0.06, -0.05, 0.3214, 25, 1 ,5 ,10 , 0.0125 , 100 ] do the following:
a. Replace any value between 1 and 4 with zero
b. Multiply any negative value with -1
c. Add 100 for the number that larger than or equal 5
d. Subtract 50 for the number that are smaller than 5
2 件のコメント
回答 (1 件)
Sarthak
2023 年 2 月 9 日
Hi,
You can look up to “Logical Indexing” section in the following documentation:
Try applying the same concept and try the questions then.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!