result = []
?? Error: File: ld.m Line: 8 Column: 1
This statement is not inside any function.
(It follows the END that terminates the definition of the function "myfun".)
result = [];
d=1:10;
for d1 = d
temp= quad(@myfun,0,2,[],0,d1); % 0~2积分区间
result = [result,temp];
end
plot(d,result);
------------------------------
这个另存之
function result = myfun(x,d)
result = x.^d;
end