下面这个程序在我的电脑和mohub-syslab online上都能正常运行,但是在学生机房的电脑上绘图部分会出错误,请问问题可能出在哪里?是安装的问题吗?请各位专家不吝指教,谢谢
出错信息是:
ERROR: MethodError: no method matching ty_fplot(::Num, ::Matrix{Int64})
Closest candidates are:
ty_fplot(::Function, ::Any)
@ TyPlot C:\Users\Public\TongYuan.julia\packages\TyPlot\FJTAa\src\Line Plots\ty_fplot.jl:27
ty_fplot(::Function, ::Any, ::Any, ::Any...; kwargs...)
@ TyPlot C:\Users\Public\TongYuan.julia\packages\TyPlot\FJTAa\src\Line Plots\ty_fplot.jl:27
Stacktrace:
[1] top-level scope
@ Untitled-1.jl:20
源程序如下:
using TyMath
using TyPlot
using TySymbolicMath
x=[1 2 3 4 5 6 7];
y=[5.0 3 2 1 2 4 7];
@variables p::Real
n=length(x);
for k in 1:n-1
for j in n:-1:k+1
y[j] = (y[j]-y[j-1])/(x[j]-x[j-k]) ;#求各阶均差
end
end
v=0.0; w=1.0;
for k in 1:n
global v=v+wy[k] ;
global w=w(p-x[k]) ;
println(v)
end
fplot(v,[1 7])
title("牛顿插值结果")