Opened 6 years ago

Last modified 6 years ago

#19502 new defect

Octave script that doesn't run

Reported by: kcrisman Owned by:
Priority: major Milestone: sage-6.10
Component: interfaces Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

See this ask.sagemath question. Apparently the Octave code below doesn't run with octave.eval(), or at least hangs or something.

# a)

function y=f(x)  
    y=3/(2+x)
endfunction

function a=p(x)  
    y1=x^2
    y2=x
    y3=1
    a=[y1,y2,y3]
endfunction

# b)

# Stützstellen vector x

x=[-1 0 1]
f(x(1))
f(x(2))
f(x(3))

# Anzahl der Stützstellen bestimmer

d=length(x)
A=zeros(d,d)

for i=1:3
    A(i,:)=p(x(i))
endfor

b=zeros(3,1)

for i=1:3
    b(i)=f(x(i))
endfor

b
[L,U,P] = lu(A)
invL=inv(L)
y=invL*P*b
invU=inv(U)
z=invU*y
A*z
b

Change History (1)

comment:1 Changed 6 years ago by kcrisman

See also #2696 for a possibly related bug (or possibly not).

Note: See TracTickets for help on using tickets.