フィルターのクリア

Checking a 1x24 Array for numbers less than 0

2 ビュー (過去 30 日間)
Calvin Wynn
Calvin Wynn 2016 年 11 月 16 日
編集済み: Changoleon 2016 年 11 月 16 日
I need assistance with changing a number less than 0 in an array to 0. I attempted to program this but I am lost. Any help would be appreciated.

採用された回答

Changoleon
Changoleon 2016 年 11 月 16 日
編集済み: Changoleon 2016 年 11 月 16 日
for example if a is the matrix
a = [ 0 2 1 -9 -8 6 100 -63 1 2 5];
you can do following
a(a<0)=0;
Now a has just the values equal or greater than zero

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by