How do I choose which CarSim database to run off of in MATLAB?

10 visualizaciones (últimos 30 días)
Maxwell
Maxwell el 12 de Jun. de 2023
I am currently working on an implementation of CarSim and MATLAB. I am using multiple databases and need to know if there's a way to programmatically set the database to use in MATLAB. I have had very little luck finding documentation for CarSim integration in MATLAB, so if someone has a source for that, that would additionally be much appreciated.

Respuestas (1)

Akanksha
Akanksha el 19 de Jun. de 2025
Hey Maxwell,
Some quick pointers that might help you :
CarSim databases are typically selected via the CarSim GUI, but you can influence which database is used in MATLAB by:
  • Setting the working directory: CarSim uses the current working directory to locate the database files. You can set this in MATLAB using:
cd('C:\Path\To\Your\CarSim\Database')
  • Using environment variables: Some setups rely on environment variables like VS_ROOT or VS_DATABASE to locate the database. You can set these in MATLAB using:
setenv('VS_ROOT','C:\Path\To\Your\CarSim')
setenv('VS_DATABASE','C:\Path\To\Your\CarSim\Database')
  • Calling CarSim from MATLAB: If you're using the VehicleSim API (VS API), you can initialize the simulation with a specific database path using the vs_load or similar functions provided in the SDK.
Here are the official MathWorks documentation and resources that support CarSim integration with MATLAB and the use of environment variables:
CarSim Integration with MATLAB & Simulink -
Here is a MATLAB Answers post by MathWorks explaining integrating with MATLAB and Support -
Hope this helps!

Categorías

Más información sobre Reporting and Database Access en Help Center y File Exchange.

Productos


Versión

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by