how can I plot this function?

My problem is how to plot this function

5 Kommentare

KALYAN ACHARJYA
KALYAN ACHARJYA am 26 Okt. 2022
Niloufar
Niloufar am 26 Okt. 2022
The power in denominator is two
David Hill
David Hill am 26 Okt. 2022
Is it a function in f(x,r,t) or f(x,r) or f(r,t) or f(x,t) or f(x), f(r ) or f(t). What are the bounds or inputs for x, r, and t?
Niloufar
Niloufar am 27 Okt. 2022
f(t) the bound for t is -5 to 5
Niloufar
Niloufar am 27 Okt. 2022
close all;clear;clc; t = linspace(-5,5,1000); %ylim([-0.01 0.01]); N = 1000;
syms n t; an = (100*n*pi*(-1).^(n+1).*(1000-121*n.*n*pi*pi))/((1000-121*n.*n*pi*pi)^2 + (1320*n*pi)^2)*(50*n*pi); bn = (100*n*pi*(-1)^(n+1)*(1320*n*pi))/((1000-121*n.*n*pi*pi)^2 + (1320*n*pi)^2)*(50*n*pi); f = symsum(an.*cos(100*n*pi*t) + bn.*sin(100*n*pi*t),n,1,Inf); fplot(f);
I have done it with Symsum but it doesn't work.what is the problem

Melden Sie sich an, um zu kommentieren.

Antworten (1)

David Hill
David Hill am 27 Okt. 2022

0 Stimmen

t = linspace(-5,5,1000);
N = 1000;n=1:N;
an = (100*n*pi.*(-1).^(n+1).*(1000-121*n.^2*pi^2))/(((1000-121*n.^2*pi^2).^2 + (1320*n*pi).^2).*(50*n*pi));
bn = (100*n*pi.*(-1).^(n+1).*(1320*n*pi))./(((1000-121*n.^2*pi^2).^2 + (1320*n*pi).^2).*(50*n*pi));
f = @(t)sum(an.*cos(100*n*pi*t) + bn.*sin(100*n*pi*t));
for k=1:length(t)
F(k)=f(t(k));
end
plot(t,F)

Tags

Gefragt:

am 26 Okt. 2022

Beantwortet:

am 27 Okt. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by