I have the following problem, I have the following set of equations including symbolic terms,
eq = K*U == F;
I solved the set of equations according to,
FU_antwoord = solve(eq,[F(1), U(2), U(3), U(4)]);
This provides me with an 1×1 struct with 4 fields (FU_antwoord), now I want to convert these to numerical values:
u2 = double(FU_antwoord.U2);u3 = double(FU_antwoord.U3);u4 = double(FU_antwoord.U4);
This works, but I'll have an arbitrary number elements U's (U5, U6, …). I tried to work with fprintf, to eventually double these expressions, but this did not work.
for i = 1:N_elementsFPF = fprintf('M_antwoord.U%1.0f\n', i)end
What is a more constructive way of retrieving the numerical values from a structure with an arbitrary number of elements?
Best Answer