Add 3 to the values of x that are even

 채택된 답변

Friedrich
Friedrich 2011년 10월 11일

1 개 추천

Hi,
x(find(mod(x,2) == 0)) = x(find(mod(x,2) == 0)) + 3
or
ind = find(mod(x,2) == 0);
x(ind) = x(ind) + 3;

추가 답변 (2개)

Arash
Arash 2011년 10월 11일

0 개 추천

Thank you. It works !!

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2011년 10월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by