y = inline('sin(x) / (1 + 3 * x + x * x)', 'x')
function Z = calcul(x1, x2, x3)
Z = x1 ^ 2 + 2 * x2 ^ 2 + 3 * x3 ^ 2 + 2 * x1 * x2 + 3 * x2 * x3 + 5 * x2 * x3;
% calcul(x1, x2, x3) is a design formulas
% The x1, x2, x3 must be number
% For example calcul(1, 1, 1)
% ans =
% 16
clc
clear
x = input('please input a number');
str = num2str(x);
for i = 1 ; length(str)
r(i) = str2double(str(i));
end
if length(r) == 1
disp('the answer is 0');
else
for j = 2 ; length(r)
s = find(r(1 : j - 1) > r(j))
u(j) = length(s)
result = sun(u)
end
disp('the ansser is');
disp(result);
end
来源:https://blog.csdn.net/weixin_45138230/article/details/102760046