bugGNU Octave - Bugs: bug #32045, demo for mkpp throws an error.

 
 

bug #32045: demo for mkpp throws an error.

Submitter:  Ben Abbott <bpabbott>
Submitted:  Tue 04 Jan 2011 01:28:31 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 15 Apr 2011 12:08:19 PM UTC, comment #2: 

Works for me as well.

Thanks

Ben Abbott <bpabbott>
Group Member
Fri 15 Apr 2011 09:31:34 AM UTC, comment #1: 

Ben,

the demo seems to work with my recent push now, can you check as well and close this bug?

Kai

Kai Habel <kahacjde>
Group Member
Tue 04 Jan 2011 01:28:31 AM UTC, original submission:  


octave:2> demo mkpp
mkpp example 1: # linear interpolation
 x=linspace(0,pi,5)';
 t=[sin(x),cos(x)];
 m=diff(t)./(x(2)-x(1));
 b=t(1:4,:);
 pp = mkpp(x, [m(:),b(:)]);
 xi=linspace(0,pi,50);
 plot(x,t,"x",xi,ppval(pp,xi));
 legend("control","interp");

mkpp example 1: failed
mkpp: num intervals in x doesn't match num polynomials in P


Comparing to Matlab, the fields for the piecewise polynominal (pp) are different, but there is no error.


x = linspace (0, pi, 5)';
t = [sin(x), cos(x)];
m = diff (t) ./ (x(2) - x(1));
b = t(1:4,:);
pp = mkpp (x, [m(:), b(:)])

pp =

      form: 'pp'
    breaks: [0 0.7854 1.5708 2.3562 3.1416]
     coefs: [4x4 double]
    pieces: 4
     order: 4
       dim: 1

pp.coefs

ans =

    0.9003   -0.3729         0    1.0000
    0.3729   -0.9003    0.7071    0.7071
   -0.3729   -0.9003    1.0000    0.0000
   -0.9003   -0.3729    0.7071   -0.7071


Ben Abbott <bpabbott>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kahacjde (Posted a comment)
  • -email is unavailable- added by bpabbott (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-04-15 bpabbott StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2011-04-15 kahacjde StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code