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 CenterFile Exchange에서 Reporting 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