| MATLAB Central > MATLAB Newsreader > Store Historical Data in Level2 M Function Dwork V... |
|
|
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Tiger Date: 28 Feb, 2013 22:13:09 Message: 1 of 8 |
|
Hi guys, |
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Tiger Date: 28 Feb, 2013 22:18:09 Message: 2 of 8 |
|
Hi again, I though of posting here the Level 2 code I did: |
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Phil Goddard Date: 1 Mar, 2013 22:17:09 Message: 3 of 8 |
|
The code in your original post does what it is supposed to do. |
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Tiger Date: 3 Mar, 2013 15:25:07 Message: 4 of 8 |
|
Phil, thanks indeed. I can see now why I was expecting somehing different from what I programmed it, the Dwork, to do. |
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Tiger Date: 3 Mar, 2013 18:26:08 Message: 5 of 8 |
|
For the benefit of everyone else, if you'd like to store historical values in Dwork vector, and my little experiment above, in my 1st post, is matching what you want to do, then follow the code below. Thanks Phil, my code works now, and the scope outputs ones at the 11th sample time onwards. Although my real application is slightly more complicated than this, but at least I got the foundations right, I'll build on it. In fact, what I want to be able to do, is storing only unique values from Input(1), as I might receive duplicates, which is a waste of, storing-wise, Dwork space. |
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Phil Goddard Date: 4 Mar, 2013 14:33:08 Message: 6 of 8 |
|
|
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Tiger Date: 5 Mar, 2013 20:31:09 Message: 7 of 8 |
|
Hi Phil, |
|
Subject: Store Historical Data in Level2 M Function Dwork Vector From: Tiger Date: 6 Mar, 2013 02:23:08 Message: 8 of 8 |
|
I managed to debug it and found out that the problem resides at having the Level-2 M Function receiving more than one value instantaneously. Thus, Dwork(1) only stores one value and discards the rest. I had to manually change the Service Time of clashing entities so they arrive at the Level-2 function in different time samples. |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| simulink | Phil Goddard | 1 Mar, 2013 17:19:14 |
| simulink | Tiger | 28 Feb, 2013 17:14:12 |
| level2 mfunction | Tiger | 28 Feb, 2013 17:14:12 |
| access simulation ... | Tiger | 28 Feb, 2013 17:14:12 |
| dwork vector | Tiger | 28 Feb, 2013 17:14:12 |
