Merge struct with matrix
3 views (last 30 days)
Show older comments
Hello,
i have a stuct which holds 12 signals. The signals are represented by frequency, power and a vector for each of the signals as seen in the following picture:
I have another matrix of the signals which passed through some model as seen in the follwoing picture:
I would like to merge the struct with the matrix, so that the struct will hold another column/new field where each struct row corresponts to each matrix row. How can I do this w/o for loop?
Thanks!
0 Comments
Accepted Answer
More Answers (1)
Dhruv G
on 21 Jul 2021
say the structure is named s,
s.outputSignal = modelOutputSignal;
adds the matrix as an element to the structure. You can then reference a matrix element as s.outputSignal(rowNumber, columnNumber)
See Also
Categories
Find more on Structures 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!