How to recursively add fields in a structure.
Mostra commenti meno recenti
Hey there!
I am trying to recursively add results into a single structure from the following piece of code: http://www.mathworks.com/matlabcentral/fileexchange/18160-evaluate-nelson-siegel-function/content/nelson/nelsonfit.m
This function returns a structure with two field which have dimensions of 1x1 and 4x1 respectively. Instead of the input y, which in the example is a 1x11 vector, I would like to insert an array with multiple rows. I thought I should write a different function which repeats the nelsonfit function with as input y each time a different row of matrix X. That is not the problem, however I am stuck with adding the returned values of the nelsonfit function. I can add the structures but it creates a 1x2 structure while I need a 1x1 structure where the fields are simply concatenated.
Any tips or hints would be much appreciated!
Kind regards,
Michael
Risposta accettata
Più risposte (1)
Michael
il 13 Giu 2014
0 voti
Categorie
Scopri di più su Structures in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!