How to avoid creating 1x1 struct?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!