adding values in array
2 ビュー (過去 30 日間)
古いコメントを表示
Hi suppose I have two variable
idx1=
1
2
3
idx2=
4
5
I need to have a third variable idx3 where idx3=
1
2
3
4
5
NB. idx1 and idx2 are linear indices and idx3 is the indices having all idx1 and idx2
0 件のコメント
採用された回答
Yoav Livneh
2011 年 9 月 8 日
If idx1 and idx2 are row vectors you can do
idx3 = [idx1 idx2];
If they are column vectors do
idx3 = [idx1; idx2];
1 件のコメント
Jan
2011 年 9 月 8 日
And if you don't know the orientation of the vectors: idx3 = cat(1, idx1(:), idex2(:)).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!