How to avoid creating 1x1 struct?
Afficher commentaires plus anciens
I have created within for loop a 1x8 struct origStruct which is visual and very easy to read.

now I also have to do separately another 1x35 struct with interpolated data. Hower, all I can create is this annying 1x1 stuct with 2 fields. what i'm doing wrong?
code is:
newStruct.b = linspace(origStruct(1).b,origStruct(end).b ,35);
newStuct.e = spline(origTimeSteps,[origStruct.e],35);
and I get this which serves no purpose whatsoever since it doesent look like table:

tried code versions like:
newStruct{:}.b = linspace(origStruct(1).b,origStruct(end).b ,35);
newStruct{1:35}.b = linspace(origStruct(1).b,origStruct(end).b ,35);
newStruct.b = deal(linspace(origStruct(1).b,origStruct(end).b ,35));
but none does give proper outcome
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!