Thread Subject: Simple simulink problem

Subject: Simple simulink problem

From: Ashwini Deshpande

Date: 21 Oct, 2009 06:19:02

Message: 1 of 5

Hi,

In simulink i have defined a array as follows using constant block:
a=[1 0 1 1 1 0 0 0 1];

Now i want to read the elements of array 'a' one by one, i mean at every sample time one element in ascending or descending order.

How do i do this ??

In otherwords if scope block is connected to the arrary, i suppose to see a binary signal of zeros and ones there.

Thanks !
Ashwini

Subject: Simple simulink problem

From: Arnaud Miege

Date: 21 Oct, 2009 11:39:29

Message: 2 of 5


"Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in message
news:hbm94m$9bn$1@fred.mathworks.com...
> Hi,
>
> In simulink i have defined a array as follows using constant block:
> a=[1 0 1 1 1 0 0 0 1];
>
> Now i want to read the elements of array 'a' one by one, i mean at every
> sample time one element in ascending or descending order.
>
> How do i do this ??
>
> In otherwords if scope block is connected to the arrary, i suppose to see
> a binary signal of zeros and ones there.
>
> Thanks !
> Ashwini
>

Don't use the constant block, use the repeating sequence block:
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/repeatingsequence.html

HTH,

Arnaud

Subject: Simple simulink problem

From: Ashwini Deshpande

Date: 21 Oct, 2009 13:02:20

Message: 3 of 5

 
> Don't use the constant block, use the repeating sequence block:
> http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/repeatingsequence.html
>
> HTH,
>
> Arnaud
>
Thanks ,
My requirement something similar to the repeating sequence block, there i want to have the sequence of zeros and ones, but it expects that the sequence should be in ascending order.
what do i do??
Ashwini

Subject: Simple simulink problem

From: Arnaud Miege

Date: 21 Oct, 2009 14:12:47

Message: 4 of 5


"Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in message
news:hbn0os$a6e$1@fred.mathworks.com...
>
>> Don't use the constant block, use the repeating sequence block:
>> http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/repeatingsequence.html
>>
>> HTH,
>>
>> Arnaud
>>
> Thanks ,
> My requirement something similar to the repeating sequence block, there i
> want to have the sequence of zeros and ones, but it expects that the
> sequence should be in ascending order.
> what do i do??
> Ashwini
>

You are right, I was a bit too hasty. Use the repeating sequence stair block
instead:
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/repeatingsequencestair.html

HTH,

Arnaud

Subject: Simple simulink problem

From: Ashwini Deshpande

Date: 22 Oct, 2009 04:22:03

Message: 5 of 5

>
> You are right, I was a bit too hasty. Use the repeating sequence stair block
> instead:
> http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/repeatingsequencestair.html
>
> HTH,
>
> Arnaud
>
Thank you very much...
Got the solution .... :-))

Ashwini

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

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 Ashwini Deshpande 21 Oct, 2009 02:24:06
array Ashwini Deshpande 21 Oct, 2009 02:24:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com