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

8 vues (au cours des 30 derniers jours)
Maxwell
Maxwell le 12 Juin 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.

Réponses (1)

Akanksha
Akanksha le 19 Juin 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!

Catégories

En savoir plus sur Reporting and Database Access dans Help Center et File Exchange

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by