Skip to main content

Executing Matlab from command line

Passing an argument from command line to Matlab script can be tricky because

There are two solutions I can think of right now:
  1. Set the environment variables before starting Matlab
    1. Using BASH shell, one may set the environment variable using the command: a=1;b=2
    2. Start Matlab using the command: matlab -nojvm -nosplash
    3. Inside matlab script one can get those variables using the command: a=getenv(a); b=getenv(b).
  2. Using the argument "-r"
    1. matlab -nojvm -nosplash -r "a=1;b=2; aScriptName;"

Comments

Popular posts from this blog

Web App Scaling with Flask Blueprint and Namespaces

A real-world Flask-RESTX-based API  may have multiple namespaces. The best practice for scaling a web application is to use a blueprint along with multiple namespace. The namespace is used to group a set of CRUD operations for a specific resource.  Blueprint can be used to combine (mixing) multiple namespaces. Here’s an example directory structure: project\ ├── app.py # Application file ├── apis #    ├── v20 # API directory    │   ├── __init__.py    │   ├── specs.py # API namespaces and REST methods    │   ├── steps.py # API namespaces and REST methods    └── v20bp.py # API blueprint file Here is an example app.py. Using a blue print allow you to mount your API on any url prefix. from flask import Flask from apis.v20bp import blueprint as api app = ...