フィルターのクリア

vector thats sorts values , even or odd, using only function

1 回表示 (過去 30 日間)
ff gvghh
ff gvghh 2017 年 6 月 19 日
回答済み: Julian Hapke 2017 年 6 月 19 日
Write a function that accepts a vector of positive integers (not to be checked) and returns the vector when all the double digits are listed at the beginning of the vector and all odd numbers are registered at the end of the vector after the pair. Do not use loops.
can some one help please :))
  2 件のコメント
Guillaume
Guillaume 2017 年 6 月 19 日
can some one help please
As soon as you show us what you've done so far and which part is causing you problem.
Without any demonstration of effort on your part, not really.
Jan
Jan 2017 年 6 月 19 日
I agree with Guillaume: This sounds like a homework question. Then please post, what you have tried so far and explain the remaining problems.

サインインしてコメントする。

回答 (1 件)

Julian Hapke
Julian Hapke 2017 年 6 月 19 日
I agree with Guillaume and Jan, you should explain a bit more of your problem. I'm not going to write the function, but here are some hints on how to get started:
sort to get the order right
mod to find even / odd numbers. see also here.
if you need further assistance, please give us an example of input and expected output and of course your work so far.

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by