[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
polyderiv problem?
From: |
Joe Koski |
Subject: |
polyderiv problem? |
Date: |
Fri, 28 Jan 2005 12:57:24 -0700 |
User-agent: |
Microsoft-Entourage/11.0.0.040405 |
When doing a larger script, I had this problem. Here is the short version of
what happened.
If I run the simple script:
function run_poly_test
x = [1:5]
y = rand(1,5)
n=3
[coeff,mat] = polyfit(x,y,n);
coeff
d_coeff1 = polyderiv(coeff')
d_coeff2 = polyderiv(coeff)
I get the following output:
octave:4> run_poly_test
x =
1 2 3 4 5
y =
0.15180 0.69255 0.77507 0.26829 0.58182
n = 3
coeff =
0.10655
-1.03346
3.00537
-1.94867
d_coeff1 =
0.31964 -2.06693 3.00537
error: product: nonconformant arguments (op1 is 3x1, op2 is 1x3)
error: evaluating binary operator `.*' near line 91, column 20
error: evaluating assignment expression near line 91, column 5
error: called from `polyderiv' in file
`/usr/local/share/octave/2.1.64/site/m/octave-forge/FIXES/polyderiv.m'
error: evaluating assignment expression near line 8, column 10
error: called from `run_poly_test' in file `/Users/jakoski/Codes/octave test
files/run_poly_test.m'
octave:4>
In other words, I need to transpose the output coefficients from polyfit
into a row vector before they will work with polyderiv. This is on a Mac
running OS X 10.3.7 with octave 2.1.64.
Is this a MATLAB compatibility "feature," a bug, or am I missing something?
Joe
-------------------------------------------------------------
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
-------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- polyderiv problem?,
Joe Koski <=