Matlab Variables used in MIJ commands?

Hi just to start my programming knowledge is basically non-existent. What I am trying to write some code in matlab to automate some image analysis. I was wondering if it was possible for variables declared in matlab to then be used by fiji.
for example:

x='/some/data/dir'
MIJ.run('Open...','path[x]')

Any help would be appreciated.

Welcome to the forum, @idk_HelpPlz!

If that’s the case, maybe doing two things at once (Matlab and [Java-based] ImageJ commands) is not the easiest way to start. Why don’t you simply use the ImageJ Macro language to automate your task?

Did you have a look at the MATLAB Scripting page on the wiki?

It outlines how to pass variables between Matlab and Fiji.