Hello
I have a matrix that is 89×4. I've used a for loop to extract each row of data to make 89 new matrices. I needed to do that because each row is a new nodal point in my data set. What I need to do now is make a structure array with a list of each nodal point.
My original for loop is
for n=1:89; eval(['Node_' num2str(n) '=nodeXYZ(n,:);']);end
That gives me each matrix (Node_1 to Node_89). I've tried to used dynamics naming within a for loop to make a different array within a structure for each node but I keep getting errors. Or when it works its completely wrong.
Triangle_points.node_data.nodes=struct('Node',Node_1); for field='Node'; Triangle_points.node_data.nodes.(field)=Node_1; end
That is along the lines of what I'm trying. Its probably very wrong, which is why I need the help. I really don't want to have to write out 89 different fields and values! Any suggestions or help on this would be appreciated.
Best Answer