Cannot use set_param() to run a simulation in a MATLAB session that does not have a display.

Open
#36 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Start by reproducing the documented start_matlab(option="-nodesktop") and set_param calls in the stated Python 3.7, MATLAB R2020a, Linux environment. Compare the set_param and sim documentation cited in the issue; done means identifying whether this is expected behavior or a reproducible Engine-specific defect and documenting a supported resolution.

Written by the indexing model from the issue text.

Description

Hello,

I'm currently using MATLAB Engine for Python on a Linux system. When I run the following commands:

self.eng = matlab.engine.start_matlab(option="-nodesktop")
self.eng.set_param(self.modelName, 'SimulationCommand', 'start', nargout=0)

I encounter the following error:

matlab.engine.MatlabExecutionError: You cannot use set_param to run a simulation in a MATLAB session that does not have a display.
I found information in the MATLAB documentation (set_param) mentioning that if you start a session with matlab -nodisplay, you cannot use set_param to run a simulation. The -nodisplay mode does not support using set_param for simulation, and it suggests using the sim function instead.

However, I am hesitant to use the sim function because according to the documentation, certain functionalities like pause and continue are not supported.

I would like to understand why I am encountering this issue when I have not explicitly set -nodisplay. Could this be specific to using MATLAB Engine on a Linux system? Is there any recommended method to address this issue on Linux?

Additionally, please find below details about my environment:

Python Version: 3.7
MATLAB Version: R2020a
Operating System: Linux
Your assistance in resolving this matter would be highly appreciated.

Thank you.

Dominant language
Python
Stars
97
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathworks/matlab-engine-for-python

All issues in mathworks/matlab-engine-for-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.