在数值实验上机课程中,学生使用 Matlab 还存在很多问题,这里总结一下,并给出详细的 示例与解释。
function val = compute(x) val = sin(4*pi*x.*x) + cos(pi*x.^2)*sin(pi*x.^3); end
x = [0.1, 0.2, 0.3, 0.4]; val = compute(x);