MATLAB Answers

Translated by

이 페이지의 내용은 영어에서 자동 번역되었습니다. 자동 번역 기능을 해제하려면 "<a class="turn_off_mt" href="#">여기</a>"를 클릭하십시오.

0

while/for loop

Asked by Arashdeep Dhillon on 17 Apr 2019
Latest activity Answered by dpb
on 17 Apr 2019
So I have a vector V of which i found its length and i hv used fprintf to print the statement. Now how do i create a new vector from that doubles the elements that are positive and divisible by 3 or 5, raises to the power of 3 the elements that are negative but greater than -5 and excludes all other elements. I know i have to use a for or while loop for this but how would i do so?

  0 Comments

Sign in to comment.

1 Answers

dpb
Answer by dpb
on 17 Apr 2019

"know i have to use a for or while loop..."
Not with Matlab, no! Use Logical indexing (link) as illustrated...

  0 Comments

Sign in to comment.



Translated by