필터 지우기
필터 지우기

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
  댓글 수: 2
Rik
Rik 2020년 5월 7일
As I suggested earlier, you should really consider doing a basic Matlab tutorial. Have you already done that?

댓글을 달려면 로그인하십시오.

채택된 답변

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
Rik
Rik 2020년 5월 7일
Glad to be of help.
If you feel my answer solved your issue, please consider marking it as accepted answer.

댓글을 달려면 로그인하십시오.

추가 답변 (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