Scalar expansion for data store memory initialization simulink
1 view (last 30 days)
Show older comments
I'm trying to use a Data Store Memory block in Simulink. I'd like to specify the dimensions and use scalar expansion to initialize the store, which the documentation describes as being possible. However, I keep getting an error that the dimensions of the initial value do not match the dimensions of the store, and the unhelpful tip to use "-1" to infer dimensions from the initial value.
I'm not sure what I'm doing wrong. What is the proper syntax for each field to get the scalar expansion behavior to kick in?
0 Comments
Answers (1)
Akshat Dalal
on 2 Mar 2025
Hi Thomas,
I believe this error could be because of the following scenario: You might have put the dimensions to "-1" and also selected scalar expansion but the intial value might be a scalar. If that's the case, then it is an expected issue since the dimensions inferred are that of a scalar value and the scalar expansion is of no use. The scalar expansion will kick in if you explicitly specify matrix dimensions instead of "-1". The error you're getting is probably due to a mismatch in the dimensions the DSM block calcluated(scalar) and the value being fed to it via Data store read/write blocks(matrix).
0 Comments
See Also
Categories
Find more on Sources 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!