Show on user profile page the commissions he is connected to I have a commissions section in where we have a matrix field where we add the user (from craft.users) and the function of the user.

A user can be in more that one commissions.

On the user profile page, we want to show besides some personal information, all the commissions in which he is active.

For a single relation field (user type field), we have no problem, but I can't get it working with this matrix field.

Matrix field info:

Section: commissionmembers
Blocktype: members 
Fields: member (fieldtype users)
        function (plain text)

This is a working example with a Users field

    {% for user in craft.users.id( craft.request.lastSegment ).limit(1) %}
    {% set commissions = craft.entries.section('commissions').relatedTo(user) %}
        {% for commission in commissions %}
            {{ commission.title }}
        {% endfor %}
    {% endfor %}


Hope you can point me in the right direction how to get it working with the matrix field
You’d need to query for all Matrix Blocks the user is related to using a Matrix Block ElementCriteriaModel. Unfortunatelly this is not possible from the template level by default, you need to either install the plugin Low Blocks, or write some some lines of PHP in a custom plugin.

Here’s how you would have to set the params for the Low Blocks function:

{% set userId = craft.request.lastSegment %}
{% set user = craft.users.id(userId).first() %}

{% if not user %}
    {% exit 404 %}
{% endif %}

{% set matrixField = craft.fields.getFieldByHandle('commissionmembers') %}

{% set blocks = craft.lowblocks.blocks.fieldId(matrixField.id).type('members').relatedTo({
    targetElement: userId,
    field: 'member',
}) %}

{% for block in blocks %}
    {% set commission = block.getOwner() %}

    {{ commission.title }}
    {{ block.function }}
{% endfor %}