Checking a 1x24 Array for numbers less than 0
조회 수: 6 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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
추가 답변 (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!