How do I swap the elements in two arrays?

5 次查看(过去 30 天)
Hi, I have these two arrays:
a={'sin', {0, '2*pi', 'pi/100'}, logical([0 1 1 0])};
b={'cos',{'-pi','pi','pi/15'},logical([0 0 0 1])};
Now I want to swap the third cell in a and b?
Thanks!

采纳的回答

John D'Errico
John D'Errico 2017-11-20
Do you mean this?
[a{3}, b{3}] = deal(b{3},a{3});

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by