Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How do I write a matlab code that requests the user for an array of integers and stores that array into the variable called A. How do I determine whether the integer is odd or even.

조회 수: 2 (최근 30일)
If an integer is odd, I need to store that integer in a separate matrix.
Otherwise, I need to store that integer in another matrix.
One matrix should contain all the odd integers from variable A and the other matrix will be a matrix containing all the even integers from variable A.

답변 (1개)

Marc Jakobi
Marc Jakobi 2016년 10월 24일
doc input
Will tell you how to get user input.
doc mod
could be useful for finding out if a number is odd or even.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by