필터 지우기
필터 지우기

Warning: Input argument might be unused and value assigned might be unused

조회 수: 14 (최근 30일)
Daniel Cifuentes
Daniel Cifuentes 2022년 10월 30일
편집: Torsten 2022년 10월 30일
I got a problem with my code, im trying to do a Fourier series function, but when i instance the function (y) says that might be unused and i dont undertand why.
Also, that happens to my result (s), when i put (s) as a "syms" says that might be unused
function [s]=FourierNuevo(y,T,B,max)
syms x n y s
p=(T-B)/2;
A0=(1/p)*int(y,[-p p]);
an=(1/p)*int(y*cos(pi*n*x/p),[-p p]);
bn=(1/p)*int(y*sin(pi*n*x/p),[-p p]);
As=an*cos(pi*n*x/p)+bn*sin(pi*n*x/p);
s = A0/2 ;
for k=1:max
s=s+subs(As,n,k);
end
end
This is my code. When i run it (y) is used like a constant value. Not like a function

답변 (1개)

Setsuna Yuuki.
Setsuna Yuuki. 2022년 10월 30일
편집: Torsten 2022년 10월 30일
Holas.
Quizás es porque tu función
function [s]=FourierNuevo(y,T,B,max)
recibe la variable y, pero despues la estas reemplazando ya que declaras nuevamente y como tipo syms.
syms x n y s
Hello.
Maybe it's because your function
function [s]=FourierNew(y,T,B,max)
receives the variable y, but then you are replacing it since you declare again y as type syms.
syms x n y s

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by