How to add mcr cache path while deploying an application?

3 ビュー (過去 30 日間)
Shambhavi Adhikari
Shambhavi Adhikari 2021 年 4 月 12 日
回答済み: Swatantra Mahato 2021 年 5 月 4 日
I have a matlab script which i want to deploy as an exe. I have a constant.mat file which has constants i need for calculations in the script. While deploying the script i do add the constant.mat but, when i open the exe it doesn't load the constant.mat. I always have to load by myself. Is there a way where it automatically opens this file whenever i start the exe? I had once added a .mat file (let's call it RequiredValues.m) to some other exe i was developing. In there, i was able to add an extenal file and it took the file from cache everytime i opened the exe. But, i couldn't remember to implement the same on my current code.
It used to take the .mat file from: C:\Users\sam\AppData\Local\Temp\sam\mcrCache9.0.1\scripts1\Calculations\RequiredValues
Can anyone please help me on this?

回答 (1 件)

Swatantra Mahato
Swatantra Mahato 2021 年 5 月 4 日
Hi Shambhavi,
You can refer the link below for an example on how to include .mat files in the .exe executable generated from MATLAB Compiler.
You can follow the steps given in the example "ex_loadsave.m" script to understand how to use .mat files in your executables
Hope this helps

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by