One way to find the difference between two structures is to use the isequal
function. Here's an example:
main.m177 chars12 lines
The output will be false
because the values of the field2
fields are different. If you want to see which fields are different, you can use the structdiff
function from the File Exchange:
main.m111 chars6 lines
This will output a struct that lists the fields that are different between the two input structs.
gistlibby LogSnag