I have been creating vector graphics with the matlab2tikz tool and got the error message ! TeX capacity exceeded, sorry [main memory size=5000000]. As I found out on the matlab2tikz github page page I might be able to resolve the issue by running the lualatex command to remove the strict memory limitation. It is suggested to type into the system prompt:
lualatex main.tex
I am using a mac and therefore type this into the Terminal.
I get the following response:
MY QUESTION IS: What do I need to do to successfully run the command?

main.texin your home directory? You need to navigate into the folder containingmain.texwithcd. You can check if your are in the correct directory by typinglsin the command line. Ifmain.texis listed in the output oflsyou are in the right place. – moewe May 31 '20 at 09:08cd ~/Documents/Studium/Masterstudium\ Medizintechnik/Masterarbeit/Ausarbeitungand try to uselsI getls: .: Operation not permitted. :( Trying to uselualatex Ausarbeitung.tex, where Ausarbeitung.tex is my main.tex filename I get! I can't find file Ausarbeitung.tex.– Timon May 31 '20 at 11:10main.texneeds to be your main document file. Usually that is the file starting with\documentclass, but depending on your setup (if you have an externalised preamble that also externalises the document class) it may start differently. Ifmain.texcontains only your preamble code, it is quite probably not the right file to compile. I don't know anything about Macs, but I always thought there were Unixoid andlsshould work... (maybe this explains thelsthingy? https://apple.stackexchange.com/q/339862) – moewe May 31 '20 at 11:14lscommand and run the lualatex on mymain.texfile. It ran through with me pressingenterat each?popping up. I hope this was the right thing to do. While my LaTeX file does run through with this specific vector graphic not included it sill crashes with! TeX capacity exceeded, sorry [main memory size=5000000].if it's included. Did I do something wrong or does this just not work for me? One vector graphic with 2KB works but this with 32KB does not.Jpegs with 900+KB work fine though. How can this be? – Timon Jun 01 '20 at 11:28Texmaker. I unfortunately don't know what aFront Endis and neither what you mean by typesetting. – Timon Jun 01 '20 at 11:30?prompts when there is an error. In that case you should investigate why that error appears, fix it and re-run LuaLaTeX. – moewe Jun 01 '20 at 12:15cleanfigure()command ofmatlab2tikznow. – Timon Jun 02 '20 at 09:52cleanfigurecommand was a workaround for me. – Timon Jun 03 '20 at 07:58