I need to compare values of two fields of two different structures but with a condition on two other fields of these structures.
suppose that these are the two structures that I want to compare:
a=struct('field1',{},'field2',{},'field3',{})b=struct('field1',{},'field3',{},'field4',{})
(Of course they're both filled)
I want to comapre values of a.field1 and b.field1 if they are equal then I'll calculate a.field2 – b.field2, after that I have to find max(a.field2 – b.field2)
how can I do it ?
Best Answer