how to change the elements in array

how to change the elements of array m based on conditions below?
1. if the array starts with 11 & 2nd element=11 @ 22 then array will change to m=[11 11 22 22 33 33 44]
2. if the array starts with 22 & 2nd element=22 @ 11 then array will change to m=[ 22 22 33 33 44 11 11]
3. if the array starts with 33 & 2nd element=33 @ 44 then array will change to m=[ 33 33 44 11 11 22 22]
4. if the array starts with 11 & 2nd element=33 @ 44 then array will change to m=[11 11 33 33 44 22 22]
5. if the array starts with 22 & 2nd element=33 @ 44 then array will change to m=[ 22 22 11 11 33 33 44]
6. if the array starts with 33 @ 44 then array will change to m=[33 33 44 22 22 11 11]
can I use switch case for this?

4 件のコメント

Walter Roberson
Walter Roberson 2012 年 6 月 18 日
編集済み: Jan 2012 年 7 月 30 日
syamil syam
syamil syam 2012 年 6 月 18 日
do you another way to code this without declaring the array like this A = {[11 11] [22 22] [33 33 44]}?
Walter Roberson
Walter Roberson 2012 年 7 月 30 日
What does the notation "@ 22" mean?
Jan
Jan 2012 年 7 月 30 日
The @ notation is not clear and in consequence I do not understand the question also.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

質問済み:

2012 年 6 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by