How do I acquire the states of 20 detections simultaneously using matlab function?

1 次查看(过去 30 天)
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 个评论
Walter Roberson
Walter Roberson 2023-9-12
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) ?
Marshall Botta
Marshall Botta 2023-9-12
编辑:Marshall Botta 2023-9-12
Well Detection(i).Measurement is the double timeseries but opens up the common properties then i have to do Detections(1).Measurement.Data to actually get that data, in the matlab workspace specifically.
I am not familiar with double preicision array (code) but what it seems like, from the Matlab documents, a 1x1 struct.
But the Detection(1).Measurement comes in a 1x1 double time series and the data property is a 6x1x201 so if the double preicision array is a double array of 300x2. You couldnt multiply them from my knowledge of linear algebra.
If i understand your question correctly.
Thank you for the reponse!

请先登录,再进行评论。

回答(1 个)

Githin George
Githin George 2023-10-6
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.

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by