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]

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 1일

0 개 추천

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

댓글 수: 1

mufq zedan
mufq zedan 2016년 5월 1일
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

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

mufq zedan
mufq zedan 2016년 5월 1일

0 개 추천

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 2016년 5월 1일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

질문:

2016년 5월 1일

댓글:

2016년 5월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by