Dwork vector name assignment?

I have been using level 2 s-functions a lot lately and one major announce with them is that there doesn’t seems to be a way to rename the Dwork vetors something use full in the code. For example, when I want to assign to the Dwork vector 1 I have to do this:
Block.Dwork(1).Data = 1;
Now I noticed when you create each Dwork vector you have to assign it a name:
block.Dwork(12).Name = 'DworkName’;
It would be really nice if there is a way I would do this:
DworkName = 1;
Does anyone know a way of doing this without having to write a bunch of you own code to assign them reassign to the dwork vectors?

4 个评论

What is your use-case for renaming a Dwork during simulation? Ordinarily, characteristics like datatype, size, complexity, etc. of a Dwork do not change during simulation. Therefore, it is assumed that each Dwork stands for a certain quantity during simulation, and that doesn't change.
Kaustubha,
Thanks for your reply, but I am not 100% sure on what you are saying. I am not trying to change the size,complexity and data type of the Dwork vector during simulation. I am trying to change the Dwork vector value.
I am not currently using a use-case statement to rename a Dwork vector... I guess this is a solution to my problem but it seems a little silly.
Do you rename the Dwork vector something useful? Or I am the only guy who finds assigning to generic Dwork vectors a major annoyance?
"use-case" means "what are you trying to do that cannot be reasonably be done a different way" ?
O I miss understood what use-case meant. I gues I can assign to the Dwork vectors like this:
Block.Dwork(1).Data = 1;
However, after a while my code becomes hard to read. I would like to be able to assign to the Dwork vector using the name of the Dwork vector.

请先登录,再进行评论。

回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by