MATLAB EXAMPLES 3 / HABERLESME TEMELLERİ

 


first part of the matlab codes ;(test_v1)


clear all;
close all;
clc;
N_vec=[5 10 20 100];
[xa1 fa1]=FS_sq(N_vec(1));
[xa2 fa2]=FS_sq(N_vec(2));
[xa3 fa3]=FS_sq(N_vec(3));
[xa4 fa4]=FS_sq(N_vec(4));
figure(1);
subplot(2,2,1);
plot(xa1,fa1);
xlabel('\bfx');
ylabel('\bff(x)');
title(['\bfFourier Series: ' int2str(N_vec(1)) ' terms']);
grid on;
hold on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(2,2,2);
plot(xa2,fa2);
xlabel('\bfx');
ylabel('\bff(x)');
title(['\bfFourier Series: ' int2str(N_vec(2)) ' terms']);
grid on;
hold on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(2,2,3);
plot(xa3,fa3);
xlabel('\bfx');
ylabel('\bff(x)');
title(['\bfFourier Series: ' int2str(N_vec(3)) ' terms']);
grid on;
hold on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(2,2,4);
plot(xa4,fa4);
xlabel('\bfx');
ylabel('\bff(x)');
title(['\bfFourier Series: ' int2str(N_vec(4)) ' terms']);
grid on;

The  part of second one ;(FS_qm)


function [x,f] = FS_sq(N)
x = linspace(0,10);
f = 0.5;
for i = 1:2:N
 b = 2/(pi*i);
 f = f + b*sin(i*x);
end

Yorumlar

Bu blogdaki popüler yayınlar

WhatsApp Görüntüleri Videoları Galeride Görünmüyor

Tsk Jandarma Asker TELEGRAM Grubu 2024 Uzman Çavuş Astsubay Sözleşmeli Muvazzaf

Whatsappda Karşı Tarafta Numaram Yoksa Nasıl Anlarım Rehberinde Kayıtlı Mıyım