You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How to store scalars(continuous data) as a vector
2 views (last 30 days)
Show older comments
V Vaishnavi Kumar
on 27 Oct 2012
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
Accepted Answer
Azzi Abdelmalek
on 27 Oct 2012
Edited: Azzi Abdelmalek
on 27 Oct 2012
15 Comments
V Vaishnavi Kumar
on 27 Oct 2012
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
on 27 Oct 2012
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
on 28 Oct 2012
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
on 28 Oct 2012
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
on 28 Oct 2012
Edited: Azzi Abdelmalek
on 28 Oct 2012
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
on 28 Oct 2012
Edited: V Vaishnavi Kumar
on 28 Oct 2012
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
on 28 Oct 2012
Edited: Azzi Abdelmalek
on 28 Oct 2012
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
on 29 Oct 2012
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
on 29 Oct 2012
Kumar, I can't answer this question, because I don't know what your program is doing.
V Vaishnavi Kumar
on 31 Oct 2012
Edited: V Vaishnavi Kumar
on 31 Oct 2012
k sir..the model u given is very much useful for me to develop my simulation model...
V Vaishnavi Kumar
on 5 Nov 2012
Sir,whether do i need a reset block to ZOH, whether will it store values for every sample...
V Vaishnavi Kumar
on 5 Nov 2012
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...?
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)