Question I have is can you, in one function, pull out one field name of a structure in MATLAB. At the moment I am doing it like this
sb = 3;
TestData.Name1 = [1 2 3];
TestData.Name2 = [4 5 6];
TestData.Name3 = [7 8 9];
TestData.Name4 = [10 11 12];
condition = fieldnames(TestData);
condition = condition{sb}
So condition would come out as being
condition =
Name3
I want to know if it can be done more in a way like this
condition = fieldnames(TestData{sb});
Not an essential problem to fix but would be nice to make the code a little more elegant