How made the code as easy?
1 回表示 (過去 30 日間)
古いコメントを表示
P=[1 32 3 78 5 6 7 8 9 10] ;P is my original array which has the size is 1*10; I have Q=[2 4 7];I want delete in Q array value in P array; My expect output is P=[ 1 3 5 6 8 9 10] by using for loop only because of the size of Q array may be change ;P(:,[Q(1) Q(2) Q(3)])=[] this command use only the size of Q array is 1*3 .So I need for loop logic which is common of any array size.
0 件のコメント
採用された回答
madhan ravi
2018 年 11 月 8 日
編集済み: madhan ravi
2018 年 11 月 8 日
P(Q)=[] %edited after Jan's comment
13 件のコメント
参考
カテゴリ
Help Center および 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!