How do I acquire the states of 20 detections simultaneously using matlab function?
1 view (last 30 days)
Show older comments
Hello, using cameras I am detecting vehicles and I have the measurement data in a nested struct in a bus. This data has the states of the vehicles in terms of [x,y,z,vx,vy,vz] and this data is in a 300x1 struct (Picture "struct") and in that struct is the measurement values of all 300 detections allowed but only 20 of the matrices are nonzero values, which are the only vehicles around my vehicle (20 vehicles). The states are in a double time series (Picture "double_timeseries") and comes in a 6x1 matrix (Picture "Data).
The function im using is in the (Picture "function") which comes after the Detection concatenation (Picture "model") block. The function works but only outputs zeros.
"struct"
"Double timeseries"
"Data"
"Function"
"Model"
2 Comments
Walter Roberson
on 12 Sep 2023
Is Detections(i).Measurement something that can be multiplied by a double precision array (code), or is it something that has a field or property named Data (screen capture) ?
Answers (1)
Githin George
on 6 Oct 2023
Hello Marshall,
I would suggest using the debugging workflow for ‘MATLAB function block’ to clearly observe the input structure for ‘fcn’ function. Further, verify that the state values are updating correctly and are non-zero as expected during the simulation.
The following link describes debugging workflow for ‘MATLAB function block’.
I hope this helps.
0 Comments
See Also
Categories
Find more on Simulink Functions 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!