CVX does not work in m file

Hello to everyone

I downloaded CVX on 23 Feb. I want to test the CVX for the first time and compare it with Linprog.
I wrote my code in Matlab command and I got results with CVX. However, I tried to save my code in mfile to run it. But, my code does not work in mfile!
I am so thankful if you let me CVX has a problem with the mfile of the MATLAB or not.
This is my code:

A=[1 -1 1;3 2 4; 3 2 0];
variable x(3)
minimize (fx)
subject to
lb <= A
x <= b

That should work if the m file is in your MATLAB path or the directory from which you are running MATLAB.

What happens when you try to run the m file? Is it a script? In what sense, exactly< does the code not work using m file?


I clicked on RUN and I clicked on Add to path or Change.

But, the problem is after RUN the mfile there is no result in MATLAB command

This is the result in the MATLAB command

My problem is solved.
In fact, the name of my mfile was “linear”, which cause problems for MATLAB.
I changed it and it worked