why when I transfer signal from simulink to matlab via block 'to workspace' , I cant control the sample numbers ?

2 visualizaciones (últimos 30 días)
I want to transfer pulse genrator block that is in smiulink , to matlab but for some reason the resultion is very small ( I have few sample dots ) , while I choose 10K points , I get only 2001 . where is the problem ?
clc;clear all;close all;
sim('test_function',0.01)
size(pulse_gen.signals.values )
in the pic of 'simulink_problem' you can see that I changed, the Limit data points to last: 10e3 .
how ever I get for some reason 2001 points , why is that ,and how to fix this problem in order to get more samle points in matlab struct ? becouse the defualt sampling points is too small.. to make a good plot of the simulink results .

Respuestas (1)

Jyothis Gireesh
Jyothis Gireesh el 2 de En. de 2020
Here are a few pointers which may be of help to you:
  • In the code given above the second argument of the “sim()” restricts the total simulation time to 0.01 seconds. This time may not be enough for the pulse generator to compute 10000 points
  • The possible workarounds include dropping the second argument in “sim()” which resets the simulation time to the default value of 10.
  • Yet another workaround may be is to change the "Max step size" parameter in "Configuration Parameters" to a sufficiently low value that enough output points are generated.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by