[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lsim problem

From: Ada Cheng
Subject: Re: lsim problem
Date: Wed, 20 Oct 2004 16:23:34 -0400 (EDT)

If you look at the code of lsim, it requires rows(u)=length(t). In your case, rows(u)=1 while the length(t) is 2001. So replace u with u'.


On Wed, 20 Oct 2004, Gerrit wrote:


I am having a homework assignment which involves lsim. The homework
assignment was designed for Matlab, but i'm trying to solve it with
Octave. I already converted some necessary things (tf -> sys, freqresp
-> __freqresp__ (why?)), but I'm stuck with lsim. My input is currently

G = tf2sys([1], [2, 2, 1]);
t = 0:.01:20;
u = exp(-t) + sin(t*2)/5;
[y, tt] = lsim(G, u, t); % literally taken from homework assignment
plot(t, u, 'r', tt, y, 'b');

The fourth line gives the following error message:

error: lsim: There should be an input value (row) for each time instant
error: evaluating if command near line 59, column 3
error: called from `lsim' in file 
error: near line 12 of file `/srv/www/studie/s_en_t/opg23.m'

I don't understand this error message. The dimensions of u and t are
obviously the same: doesn't that mean there is an input value for each
time instant? How do I convert u and t so that it will work as it
probably is supossed to work with Matlab?

(sorry, I can't test it with Matlab: i don't own Matlab. The reason I'm
using Octave is a money reason)

Gerrit Holl.

Weather in Twenthe, Netherlands 20/10 21:25:
        16.0??C   wind 2.7 m/s SSE (57 m above NAP)
Ervaringen met het Syndroom van Asperger:
Socialistische Partij:

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

 Ada Cheng                              address@hidden
 Assistant Professor          
 Department of Science and Mathematics
 Kettering University
 1700 West Third Avenue
 Flint, Michigan 48504-4898

reply via email to

[Prev in Thread] Current Thread [Next in Thread]