[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lsim problem
From: |
Geraint Paul Bevan |
Subject: |
Re: lsim problem |
Date: |
Wed, 20 Oct 2004 21:28:55 +0100 |
User-agent: |
Mozilla Thunderbird 0.5 (X11/20040306) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gerrit wrote:
|
| 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
`/usr/share/octave/2.1.50/m/control/base/lsim.m'
| error: near line 12 of file `/srv/www/studie/s_en_t/opg23.m'
|
You have defined t, and hence u, as a single row instead of a single
column. If you transpose t and u (using the ' operator), it should work.
Also, if you use a recent version of Octave, you should find that tf()
works without altering the code to use tf2sys instead.
- --
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iEYEARECAAYFAkF2yocACgkQcXV3N50QmNOZYQCgjOeM7gipQOMzrWuVBgIGu7mC
a1IAn08UaXthcEN3zgBLRa1Ndf5Uob8r
=M98h
-----END PGP SIGNATURE-----
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------