Extract functionality from add-on to run program without add-on

I have a program which uses the Satellite Comunications Toolbox. My supervisor would like to be able to run the program without having to install said toolbox. I am having trouble extracting the appropriate functions from this toolbox in order to get it working in this manner..
The toolbox specific code I am using is groundStation(), satelliteScenario(), satellite(), access(), accessStatus(), aer(), and states().
My supervisor implied that I should be able to copy and paste the relevant .m files into my workspace. I am unable to locate the relevant files. Has anyone done this before? I have had trouble finding others who have attempted the same.
I am aware the Satellite Communications Toolbox has dependencies on other tooboxs. In this case, I'm imagining other files will have to be copied from those, though relating to the above statements, I am unsure as to exactly what those are.

답변 (2개)

Chunru
Chunru 2022년 8월 26일
MATLAB has a tool to find the required files for running a program.
% files = "YourMainMatlabFile.m"
[fList, pList] = matlab.codetools.requiredFilesAndProducts(files)
From here, you can check out which files to extract. It is also noted that the orighinal customised toolbox may have its own folder structure and in this case you may need to modified the individual code as well.

댓글 수: 6

Thanks for answering. Have just now tried that. fList only contains my main file. pList only contains MATLAB. This is bizzare, as if the SatCom toolbox isn't installed, the program certainely does not run.
My program has a main file and a function I created. Using "matlab.codetools.requiredFilesAndProducts(files)" on my main file only returned my main file (which is odd because it calls the function I created and won't run without it). I also tried using it on the function I created (this is what uses the material from the SatCom toolbox). Using 'matlab.codetools.requiredFilesAndProducts(files)', again, only returned the function file itself.
Have you install the SatCom toolbox first? Is the toolbox and its subfolders in the searching path?
Yes, it is installed. I have located the toolbox folders inside my MATLAB program files. Additionally, my program currently runs; without the toolbox it would not.
I see. You are using matlab SatCom toolbox, which is organized as packages and classes (with many private class functions). There might even be some p-code. It is not easy to extract the code.
A tedious way is to run your code in debugger and step through the code to see which functions are called. But it is definately not recommended.
Looking at the files, there is definitely some p-code. Thanks for the recommendation. I supposed I'll have to do that. Any tips haha?

댓글을 달려면 로그인하십시오.

Walter Roberson
Walter Roberson 2022년 8월 26일

0 개 추천

The license terms do not permit you to copy toolbox files for use by someone who does not have the toolbox.
You should have a look at MATLAB Compiler

카테고리

도움말 센터File Exchange에서 Satellite Mission Analysis에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 8월 26일

답변:

2022년 8월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by