Why is 'From Workspace' omitting values (R2011a)?

1 view (last 30 days)
My simulink model contains a From Workspace block directly feeding a To Workspace block.
The From Workspace block is reading the Structure Input :
Input.time = (0.00 : 0.01 : 100)';
Input.signals.values = zeros(1,10001)';
for k = (0:9)
Input.signals.values(k*1000+500) = 1;
end
Input.signals.dimensions = 1;
The sampling time of the 'From Workspace' block is set to 0.01 as well as the 'Fixed-step size' of the model. The Interpolate data option of the From Workspace block is unchecked. Executing the model results in a Structure with Time Output written to the workspace by the To Workspace block.
I'd expect Output.signals.values to look exactly the same as Input.signals.values . However, Output.signals.values(6500) delivers 0 wheras Input.signals.values(6500) delivers 1.
If I check the Interpolate data option of the From Workspace block, then everything works as expected. But there should be no interpolation needed as Input.signals.values contains a value for every timestep, right?
Is there a bug in From Workspace or do I misunderstand the interaction of sample time and model-execution in fixed step size?

Accepted Answer

Jochen
Jochen on 6 Dec 2013
I found the right answer for my question myself :)

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!