How can I create a random array like the example C?
古いコメントを表示
A=[1 1 2 2 7 7 9 9]
B=[3 5 6 8 10 11] : randomly choose all items from B and input between 2 same number of A
for example : C=[1 8 6 1 2 5 3 2 7 11 7 9 10 9]
4 件のコメント
KALYAN ACHARJYA
2019 年 4 月 25 日
編集済み: KALYAN ACHARJYA
2019 年 4 月 25 日
Hello Hang, this is not random array, its have certain pattern. I have tried in your v1,v2 question, still not getting the exact results as per requirement.
Hang Vu
2019 年 4 月 25 日
Jan
2019 年 4 月 25 日
Please mention the details: Does the result need to have at least one value of B between the equal elements of A? Does the order of elements of B matter? Does A have an even number of elements in every case so the new elements can be inserted at the indices 2, 4, 6, ...? Providing 1 example does not define the problem completely.
Hang Vu
2019 年 4 月 26 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!