Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using Repmat for a periodic function
Date: Sat, 6 Dec 2008 01:57:02 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 14
Message-ID: <ghcm5e$87n$1@fred.mathworks.com>
References: <ghchbn$pp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228528622 8439 172.30.248.37 (6 Dec 2008 01:57:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 6 Dec 2008 01:57:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:505322


"jay singh" <drj_86@rediffmail.com> wrote in message <
> x2(t)={ 1      0<=t<=5e-4
>             0     5e-4<t<=0.004

You have your sampled function, and you just need to replicate it, right?

Ts = 1e-4;
t1 = 0:Ts:5e-4;
t2 = 5e-4:Ts:40e-4;
x2 = [ones(length(t1), 1); zeros(length(t2), 1)]; %periodic portion of signal

% replicate it n times
n = 25;
x2p = repmat(x2, n, 1);