% arara: lualatex: { synctex: yes, shell: yes }
% arara: biber
% arara: lualatex: { synctex: yes, shell: yes } if changed('bbl')
% arara: lualatex: { synctex: yes, shell: yes } if changed('toc')
\documentclass[a4paper,12pt]{scrartcl}
\usepackage{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{listingsutf8,amssymb}
\usepackage{xcolor}
\usepackage{matlab-prettifier}
\usepackage{scrhack}
\lstset{literate ={↑}{$\uparrow$}1}
\begin{document}
\section{Introduction to MATLAB}
\subsection*{Exercise 1.3}
\begin{lstlisting}[style=Matlab-editor]
>> z = 25-(100-7exp(5+cos(pi/3))
z = 25-(100-7exp(5+cos(pi/3))
↑
Error: Invalid use of operator.
Did you mean: z = 25-(100-7*exp (5+cos(pi/3)))
>> z = 25-(100-7*exp (5+cos(pi/3)))
z =
1.6378e+03
\end{lstlisting}
\end{document}
I've tried following this answer and still my upwards arrow is invisible:
Edit
After changing my first two usepackage lines to:
\usepackage{fontspec}
\usepackage[utf8]{inputenc}
And removing the lstset, all Unicode characters now properly show, but the arrow is not put where it should be (it is at the end of the previous line, not pointing from the d to the 7):

