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

10 ビュー (過去 30 日間)
Maxwell
Maxwell 2023 年 6 月 12 日
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.

回答 (1 件)

Akanksha
Akanksha 2025 年 6 月 19 日
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!

カテゴリ

Help Center および File ExchangeReporting and Database Access についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by