Error when saving MLX file

Agustín · Nov 14, 2022 · 1.9K views
Question
I am using MATLAB R2022a in Ubuntu 20.04.5 LTS (Kernel 5.15), and whenever I try so save a .m script file I have no issues, however when I try to save a Live Editor file (.mlx), I get the next error:   Unable to save file myFile.mlx   java.lang.RuntimeException: Internal Exception in writing MLX file : Could not commit changes: copy failed: fl:filesystem:SystemError: /tmp/.bdae-ce03-39f3-5965.tmp invalid cross-device link I have tried with R2022b, but the problem persists. I have another Ubuntu station (Kernel 5.4) and it does write the file. I have read about similar errors depending on the Kernel version. Is there any solution that does not include downgrading the Kernel?
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Aug 24, 2026

This issue is a known problem with MATLAB R2022 releases on certain Linux kernels. Here are a couple of workarounds that don't involve downgrading your kernel:

  1. Change MATLAB's Temporary Directory: The default temporary directory for MATLAB on Linux is /tmp/, which can cause issues with cross-device links. You can change the temporary directory to a new folder. Here's how you can do it in the MATLAB Command Window:

    matlab
    >> clear all
    >> tempdir % Check the current temp directory
    % ans = '/tmp/'
    >> setenv('TMPDIR', '/path/to/new/tempdir') % Replace with your desired path
    >> clear all
    >> tempdir % Check the new temp directory
    % ans = '/path/to/new/tempdir'
    
  2. Use MATLAB Online: MATLAB Online provides access to MATLAB through a web browser using MathWorks-hosted resources. This can bypass the issue with saving MLX files on your local machine.

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!