i need to make this function work without puting inputs all i need to call it put the z and the n and the function will give me the answer

2 次查看(过去 30 天)
function y=int1(z,n)
syms x n m z a;
for m=1:n;
z=int(z)
end
sorry i mean this one

采纳的回答

Rik
Rik 2020-5-7
Why are you defining everything as symbolic? Why aren't you storing any output? Why are you overwriting your inputs with the syms function? The code below is one of the possible ways to answer these questions.
clc
clearvars
syms z
mySymFun= 3*z^2-9;
n=4;
y=int1(mySymFun,n);
clc,disp(y)
function z=int1(z,n)
%integrate z for n times
for m=1:n
z=int(z);
end
end
  11 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by