choose B or C or D if A does not exist – how to write this?
Hi all,
I have the following:
switch joint
case ‘Knee’
prox = ‘HipJC’;
dist = ‘LEPI’;
wand = ‘THPA’ ;
end
side = {‘R’,’L’};
for i = 1:length(side)
wandMk = data.([side{i},wand]).line;
end
I got the following error: Unrecognized field name "LTHPA", which is because ‘LTHPA’ does not exist in my structure.
I could use ‘THPP’ or ‘THDA’ or ‘THDP’ instead of ‘THPA’, because I know these exist. Hence, how could I rewrite the above for this to run?
For example:
if ‘THPA’ does not exist then
wand = ‘THDA’ or ‘THDA’ or ‘THDP’
Thanks!Hi all,
I have the following:
switch joint
case ‘Knee’
prox = ‘HipJC’;
dist = ‘LEPI’;
wand = ‘THPA’ ;
end
side = {‘R’,’L’};
for i = 1:length(side)
wandMk = data.([side{i},wand]).line;
end
I got the following error: Unrecognized field name "LTHPA", which is because ‘LTHPA’ does not exist in my structure.
I could use ‘THPP’ or ‘THDA’ or ‘THDP’ instead of ‘THPA’, because I know these exist. Hence, how could I rewrite the above for this to run?
For example:
if ‘THPA’ does not exist then
wand = ‘THDA’ or ‘THDA’ or ‘THDP’
Thanks! Hi all,
I have the following:
switch joint
case ‘Knee’
prox = ‘HipJC’;
dist = ‘LEPI’;
wand = ‘THPA’ ;
end
side = {‘R’,’L’};
for i = 1:length(side)
wandMk = data.([side{i},wand]).line;
end
I got the following error: Unrecognized field name "LTHPA", which is because ‘LTHPA’ does not exist in my structure.
I could use ‘THPP’ or ‘THDA’ or ‘THDP’ instead of ‘THPA’, because I know these exist. Hence, how could I rewrite the above for this to run?
For example:
if ‘THPA’ does not exist then
wand = ‘THDA’ or ‘THDA’ or ‘THDP’
Thanks! for loop, indexing, if statement MATLAB Answers — New Questions