Clear Filters
Clear Filters

How to copy elements of one field of structure into another new field of another structure?

3 views (last 30 days)
I have two structures, A and B. is 5X1 with each row length being 1x5. : 1x5
In structure A, I want to create a new field "data" and store the elements of in one cell i.e. = 1x25.
I think it should be easy, but I am not able to copy it in this pattern. Can any one help me out with the solution.
Thanks in advance.

Answers (1)

Ankita Nargundkar
Ankita Nargundkar on 22 Jun 2017 = cell2mat(arrayfun(@(x),B,'Uni',false))
should do the trick. Also refer to these docs for more info. cell2mat and arrayfun


Find more on Data Types in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!