MATLAB数学基础题

newyufa 1年前 已收到2个回答 举报

李兴福 幼苗

共回答了15个问题采纳率:100% 举报

(1)
A=input('inputA:=');
b=A(1);
t=1;
for i=2:20
if

1年前

8

在心里208 幼苗

共回答了11个问题 举报

%例子——求阶乘
clear
a=zeros(1,20);
sum=0;
for n=1:20
a(n)=factorial(n);
sum=sum+a(n);
end
sum
%例子——求函数值
clear
syms x y
f=x^2+sin(x*y)+2*y;
x=input('x=')
y=input('y=')
f=subs(f,'x',x);
f=subs(f,'y',y)

1年前

0
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 18 q. 0.090 s. - webmaster@yulucn.com