struct array
2 ビュー (過去 30 日間)
古いコメントを表示
Hi guys,
There are two struct arrays, A, B; They both have a member data called "id". For example: A(1).id = []; A(2).id = [] B(1).id = 'hello'; B(2).id = 'yes';
I'd like to copy the "id" of B to A without using loop.
Is there any method?
Thanks
採用された回答
Andrei Bobrov
2011 年 9 月 22 日
[A(:).id] = B.id
6 件のコメント
Andrei Bobrov
2011 年 9 月 22 日
Sorry, this is my english. I mean, you must answer the question and the author takes his
Fangjun Jiang
2011 年 9 月 22 日
Both you and Daniel provided the same good solution. I just want to point it out that (:) can be omitted. The OP didn't seem to accept many of the obviously correct answers.
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!