Why the constant-block is much slower than from workspace-block when reading from matlab workspace
Show older comments
Hello everyone.
I have two following models (image attached with the models circled 1. and 2.) producing the same output with input from the matlab workspace. Model 1 uses input speed with dimensions of Nx1 (constant block). Model 2 uses input speed_time with dimensions of Nx2 (from workspace block), first column being the timetstamp.
Why is the first model so much slower to run than the second model? I prefer using the first model, since the input to the constant block can either be one single number, or a vector variable from the matlab workspace. Do you have any suggestions to make the first model more efficient? For example, how to transform the signal in efficient way, that I can input "speed" (variable from workspace) or "5" to the constant block and it produces the correct output without error? It works now, but it's very slow.
Thank you in advance!
Accepted Answer
More Answers (0)
Categories
Find more on Model, Block, and Port Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!