フィルターのクリア

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 Center および File ExchangeNumber Theory についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by