Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8496171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:46:42+00:00 2026-06-10T23:46:42+00:00

$ matlab -nodesktop -nojvm & How would I execute matlab commands on the session

  • 0
$ matlab -nodesktop -nojvm &

How would I execute matlab commands on the session that was just created?

In other words, I want to have a matlab session running in the background, and execute matlab commands and/or scripts from an arbitrary terminal at any given time without having to create a new session.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:46:44+00:00Added an answer on June 10, 2026 at 11:46 pm

    I would suggest a similar solution as carandraug did, only I prefer tmux as the multiplexer. It may be a bit tricky getting the commands passed in correctly so create a shell-script that handles the details.

    Let’s say you’ve started matlab in a terminal like this:

    tmux new -s matlab "matlab -nodesktop -nojvm"
    

    Now a tmux session called matlab is running matlab with no gui.

    Create this shell-script:

    mx

    #!/bin/bash
    
    if [[ $# -eq 0 ]]; then
      while read; do
        tmux send-keys -t matlab "$REPLY"$'\n'
      done
    else
      tmux send-keys -t matlab "$@"$'\n'
    fi
    

    In a different terminal you can now run quoted matlab commands:

    mx "A = reshape(1:9, 3, 3)"
    

    Or even pass commands in through a pipe:

    for mat in A B C; do echo "$mat = reshape(1:9, 3, 3)"; done | mx
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Matlab, I have a loop that performs operations on arrays. I would like
Matlab has msgbox, listdlg, textscan, and many other functions that Octave apparently doesn't have.
In Matlab, I have a vector, X, that contains N real values: 0.001 0.003
I have a file.m, which is a file from matlab, and I want it
Does MATLAB have a function/operator that indicates the type of a variable (similar to
MATLAB is a pass by value language. I have a recursive function that processes
Matlab documentation states that it is possible to replace the Nth occurrence of the
In MATLAB, why does the file have to be saved prior to running ?
Apparently Matlab load loads the data from a .mat file into the variable that
In matlab I would like to read from a structured, and rather big, file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.