How to access a previous matrix field value I have a case where I need to access a previous matrix field's value (if it exists) in the next matrix loop result.

{% for contentBlock in entry.contentBlocks %}
    {% if contentBlock.prev %}
        {% if contentBlock.getPrev().matrixField | length %}
            {{ contentBlock.getPrev().matrixField }}
        {% endif %}
    {% endif 
    ....
{% endfor %}


I know that my issue is with {{ contentBlock.getPrev().matrixField }} but I am not sure how to access the field value after trying several methods.  I'm sure it's something simple.

Thanks :)
As it turns out, you must use bracketed and not dotted syntax for matrix fields.

{% for contentBlock in entry.contentBlocks %}
    {% if contentBlock.prev %}
        {% if contentBlock.prev[matrixField] is defined %}
            {{ contentBlock.prev[matrixField] }}
        {% endif %}
    {% endif 
    ....
{% endfor %}


fixed this issue for me :)