Info

此问题已关闭。 请重新打开它进行编辑或回答。

how to model a function where only one bus element is operated(rest elements are not updated)

1 次查看(过去 30 天)
Hi All,
In My function we are having a global array of objects(Type structure). in for loop we are performing operation on single element of bus,rest of the elements are used in other function we have modelled the logic,The issue we are facing is we have grounded all other members in the model,which makes all elements of object assign to zero.(which we dont want) -> how can we use one bus element in a model.
  1. define W_MAX 4typedef struct { S16 Vel_Err[W_MAX]; S16 Vel_Rng[W_MAX]; } TC_EN_CL_OBJECT;
TC_EN_CL_OBJECT Tc_En_C[W_MAX];
for (i = 0; i < W_MAX; i++) { if ( (Tc_Whl[i].Vel ==20 ) ) { Tc_En_C[W_MAX].Vel_Rng[i] =10; } else { } } Note: we have tried with bus selector,but other elements are grounded.(which we dont want)
Regards, Sai

回答(0 个)

此问题已关闭。

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by