How can I call satelliteS​cenarioVie​wer() by using Simulink (only)

3 Ansichten (letzte 30 Tage)
TK
TK am 26 Apr. 2024
Beantwortet: Animesh am 7 Mai 2025
I try the Aerospace Blockset from
mdl = "SpacecraftDynamicsBlockExampleModel";
open_system(mdl);
and Aerospace Toolbox from satelliteScenarioViewer
Finally, I see the combination of two systems from
openExample('aero_satcom/CustomSatelliteAttitudeAndGimbalSteeringExample')
Now, I want to call the function satelliteScenarioViewer in the Simulink and don't use MATLAB part (command window and script)
Is this method possible by using MATLAB system, MATLAB function block or any?
Thank you

Antworten (1)

Animesh
Animesh am 7 Mai 2025
It seems like you want to call an existing function, satelliteScenarioViewer, using Simulink. We can utilize the MATLAB function block for this purpose. In the code section of the MATLAB Function block, we can make a call to the required MATLAB function.
You can do something like this inside the MATLAB Function block:
function y = fcn(u)
viewer1 = satelliteScenarioViewer(scenario);
y = u;
Moreover, ensure that the MATLAB Function block can access the called function. If the .m file (containing the called function) is not in the current MATLAB path, you'll need to add its location to the path. This can be done by using the addpath function in MATLAB before running the Simulink model.
addpath('path_to_your_function');
You can refer to the following MathWorks documentation for more information on the MATLAB Function block:

Kategorien

Mehr zu Aerospace Applications finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by