• 2022-06-01
    下列哪些语句可以定义名为fun的函数
    A: function fun(a){alert(a);}
    B: var fun=function(a){alert(a);}
    C: var fun=Function("function fun(a){alert(a);}
    D: fun(a)
  • A,B

    内容

    • 0

      以下哪段代码能正确创建函数show() A: var showFun = new function{"text","alert(text)"}; B: function show(text){alert(text);} C: var showFun = function show(text){alert(text);} D: var showFun = function(text){alert(text);}

    • 1

      设有如下函数定义:Function fun() As Int... 显示的结果是____________。

    • 2

      定义了一个函数文件fun.m: function f=fun(n) f=sum(n.*(n+1)); 在命令行窗口调用fun函数的结果为( )。 >> fun(1:5)

    • 3

      The MATLAB function [a,Jm] = lsqcurvefit(fun,a0,x,y, opts), fun is the MATLAB description to the prototype function, which functions can be used as prototype functions.( ) A: M-function B: anonymous function C: inline function D: not sure

    • 4

      已定义函数Function fun(x1%,x2%) as integer,则下列调用语句正确的是()