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

1 visualización (últimos 30 días)
TK
TK el 26 de Abr. de 2024
Respondida: Animesh el 29 de Abr. de 2024
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

Respuestas (1)

Animesh
Animesh el 29 de Abr. de 2024
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:

Categorías

Más información sobre Get Started with Aerospace Blockset en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by