How to have a variable size array out of matlab function block and export that data to matlab (To Workspace) to plot ?

2 vues (au cours des 30 derniers jours)
I have a simulink model, there is a matlab function block in it. The output of the matlab function block is a variable sized array. Eventhough I specify the size as undefined and take the output out of the block.
I am unable to connect it to To Workspace block to take it to Matlab to plot it. It gives me error to change the type as struct or change the sample time to discrete (which i do not want to affect the whole simulation). None of the method works. I am looking forward for a suggestion.

Réponses (1)

Mark McBroom
Mark McBroom le 17 Fév 2024
Rather than connecting to a "to workspace" block, did you try right mouse clicking on the signal and marking it as "log" and then use Simulink Data INspector to plot the signal?
  1 commentaire
VIGNESH BALAJI
VIGNESH BALAJI le 19 Fév 2024
I didn't try it. The main reason I wanted to use To workspace is because I wanted to export it to matlab and then plot it using a matlab script.
I tried making the output from matlab function of this value as structure and other data types as suggested in the error suggestions and it didn't resolve the error.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by