Add 3 to the values of x that are even
이전 댓글 표시
x=[7 6 1 2 0 -1 4 3 -2 0]
how do I do this in smart short way?
채택된 답변
추가 답변 (2개)
Walter Roberson
2011년 10월 11일
x = x + 3 * ~mod(x,2);
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!