writ the program to separate the even and odd number by using for and if statement .assume the input matrix as below
a=[56 70 56 79 98 63 100 67 60 83]

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 1 de Mayo de 2016

0 votos

Use mod function, a number N is even if mod(N,2)==0

1 comentario

mufq zedan
mufq zedan el 1 de Mayo de 2016
I know that the solution to the question is using a prompt to mod , but the problem of establishing a matrix even numbers and odd numbers Matrix has you create matrices of the first matrix in question , but the problem appears to me numbers 0 within each of the matrices because of my use of the injunction for

Iniciar sesión para comentar.

Más respuestas (2)

mufq zedan
mufq zedan el 1 de Mayo de 2016

0 votos

My question is of the matrix in question I want a program that creates the first two matrices comprising all the even-numbered second matrix includes all the individual figures
mufq zedan
mufq zedan el 1 de Mayo de 2016

0 votos

I know that the solution to the question is using a prompt to mod , but the problem of establishing a matrix even numbers and odd numbers Matrix has you create matrices of the first matrix in question , but the problem appears to me numbers 0 within each of the matrices because of my use of the injunction for

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 1 de Mayo de 2016

Comentada:

el 1 de Mayo de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by