Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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 Ansichten (letzte 30 Tage)
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.

Antworten (1)

Marc Jakobi
Marc Jakobi am 24 Okt. 2016
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.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by