You can simply implement your own compare function
[compareWith]="compareItems"
See as well the docu. So the complete code would look like:
<div>
<mat-select
[(value)]="selected2" [compareWith]="compareItems">
<mat-option
*ngFor="let option of options2"
value="{{ option.id }}">
{{ option.name }}
</mat-option>
</mat-select>
</div>
and in the Typescript file:
compareItems(i1, i2) {
return i1 && i2 && i1.id===i2.id;
}