How to store scalars(continuous data) as a vector

an embedded matlab function block1 outputs scalars instantaneously, a set of sequential scalar outputs (ex: minimum 3 or more outputs) has to be stored as a vector, embedded fcn block2 accepts vector input and compares the elements in it, how instantaneous scalars can be stored as a vetor

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 27 日
編集済み: Azzi Abdelmalek 2012 年 10 月 27 日

1 投票

15 件のコメント

V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 27 日
input vector size of embedded fcn2 is fixed only.....when i give a dutycycle to my power electronic converter(simulink model), my solar module(embedded fcn blck1) gives a power(scalar),
i m sending three dutycycles(d1 d2 d3) one by one, simultaneously corresponding power P1 P2 P3 should be sensed. i wanna concatenateP=[ P1 P2 P3 ], ........P is given embedded fcn block2(Particle swarm optimizer controller) for further processing.
what is repmat..using tat real time data could be stored..?
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 27 日
you can see what repmat do, (help repmat), but it's not what you need, if I've understood what you need, is every step time you want concatenate p1, p2 and p3. Then what I suggest is to create a matlab function with one input(P1, then P2 then P3) sampled with ts and an output [P1 P2 P3] sampled with 3*ts. If it's what you want I will post a simulink model
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 28 日
yes i feel this s wat i want...i hope, i can give scalar output power in place of digitized sine-wave., or do i need to convert the scalar output to any digitized form ,
thanks a lot for this model, request you to post the simulink model..
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 28 日
i tried your simulink model, to check it i need to send three duty cycles (d1 d2 d3)to one terminal as mentioned earlier..d1 d2 d3 has to be sent one by one sequentially with delay,
tried with 1)multiport switch 2) mux delay combination.. dint work as desired..
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 28 日
編集済み: Azzi Abdelmalek 2012 年 10 月 28 日
Maybe you have'nt understood how it works,use the first input p1 to be sent to your desired block. at the same time the matlab function block is storing p1,p2,and p3 to be sent 3 ts after. What is the problem?
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 28 日
編集済み: V Vaishnavi Kumar 2012 年 10 月 28 日
i understood the simulink model you sent, i simulated it seperately,it showed three values in P vector,[-0.9511 -0.5878 0], i took it as at 1st sample digital sine wave has the magnitude -0.9511,for 2nd sample mag is -0.5878.. so on..
>make me clear if i misunderstood
>at the input side without ZOH also, it showed same output, what's its specific purpose
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 28 日
Yes, but what is the problem?
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 28 日
no problem... jus wanted to know the purpose of ZOH
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 28 日
編集済み: Azzi Abdelmalek 2012 年 10 月 28 日
Ok, the zoh will maintain the same output during its sample time. where I've used a unit delay I did'nt add a zoh, because a unit delay do the same thing (plus delaying)
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 29 日
thank u, i hope u had kept a digitized sinewave earlier, now it seems to be a continuous one, in my model, my solar module sends continuous data of power
do i need to make any analog to digital conversion..?
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 29 日
Kumar, I can't answer this question, because I don't know what your program is doing.
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 10 月 31 日
編集済み: V Vaishnavi Kumar 2012 年 10 月 31 日
k sir..the model u given is very much useful for me to develop my simulation model...
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 11 月 5 日
Sir,whether do i need a reset block to ZOH, whether will it store values for every sample...
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 5 日
Kumar, what do you mean?
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 11 月 5 日
my faculty raised this question, when ZOH1 holds the values of three sample, for the next sample time, will it hold the next sample value with out resetting,or wil it have the previous values stored before
I simulated the ZOH1 block with display1 in your model, kept a display2 before ZOH1,
I saw that display1 showed values before simulation finishes, values in display2 were changing,
how it could be interpreted...?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSchedule Model Components についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by