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

5 Ansichten (letzte 30 Tage)
Maxwell
Maxwell am 12 Jun. 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.

Antworten (1)

Akanksha
Akanksha am 19 Jun. 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!

Kategorien

Mehr zu Reporting and Database Access finden Sie in Help Center und File Exchange

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by