Updated Answer
Turns out the original answer only works if you've got an single instance of a Matrix Block on the entry. If you have multiple, it will search through all of them and return results for any block that has any of the relations you're looking for, in spite of the inclusion of and
.
As of the next post-3.0.9 release, you'll be able to get relational matches from individual Matrix Block instances using a method like so:
{% set targetModel = craft.categories.id(5).one() %}
{% set targetPart = craft.categories.id(20).one() %}
{# be sure and set the field ID of the Matrix field you're interested in here %}
{% set entryIds = craft.matrixBlocks.fieldId(55).relatedTo(['and',
{ targetElement: targetModel, field: 'model' },
{ targetElement: targetPart, field: 'part' },
])
.select(['ownerId'])
.distinct()
.column()
%}
{% set entries = craft.entries.id(entryIds).all() %}
{# display the results #}
Total: {{ entries|length }}<br>
<ul>
{% for entry in entries %}
<li>{{ entry.title }}</li>
{% endfor %}
</ul>
Original Answer
Assuming the setup in your question, something like this should work:
{# These are just two examples, but get the relevant target model and part categories however you want #}
{# resolve to the "Cessna" category #}
{% set targetModel = craft.categories.id(4).one() %}
{# resolve to the "Propx45" category #}
{% set targetPart = craft.categories.id(6).one() %}
{% set entries = craft.entries.section('flightCompany').relatedTo(['and',
{ targetElement: targetModel, field: 'planeDetails.model' },
{ targetElement: targetPart, field: 'planeDetails.part' },
]).all() %}
{# display the results #}
Total: {{ entries|length }}<br>
<ul>
{% for entry in entries %}
<li>{{ entry.title }}</li>
{% endfor %}
</ul>
Here's the relevant "relations" part of the docs: https://docs.craftcms.com/v3/relations.html
Model
andPart
are 2 separate Categories fields inside of the Matrix field "Degree Programs"? Is there only one Matrix Block in that field? – Brad Bell May 18 '18 at 21:33