How to force an external function in live scrip?

조회 수: 17 (최근 30일)
ytzhak goussha
ytzhak goussha 2021년 8월 18일
답변: Cris LaPierre 2021년 8월 18일
Hello,
I want to use a live script to present my data analysis process. However, I have a function that doesn't run in the live script, it has to be called from workspace or a plain script, and I don't want to modify it because it is not my function.
Is there a command or option that I can use to set the environment where the live script will run that specific function?

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 8월 18일
You would call it the same way you would in a script.
The only thing you need to make sure of is that your live script can find the function. That means either placing the function file in the current folder, or in a folder that has been added to your MATLAB path. Live scripts do not automatically change your current folder to the folder containing the live script file, so you do need to be more aware of what your current folder is when running.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by