Write a wellcommented MATLAB script program to plot the func
Write a well-commented MATLAB script program to plot the function f(x) = Sigma^50_k=1 Squarerootk sin(2pi kx) on the interval x Element [0, 1].
Solution
clear all; % clear all variables
clc; % clear screen
% function is divided into two components , one deals with calculation of square root and summation while other %deals with sin function
x=[0:1]; % as x varies from 0 to 1
k=1:50; % interval of summation varies from 0 to 50
y=sin(2*k*x); % sin function is used for radians and sind function is used for degrees
term = Sqrt(term)*y; % calculation of square root
plot (y,[0,1])
![Write a well-commented MATLAB script program to plot the function f(x) = Sigma^50_k=1 Squarerootk sin(2pi kx) on the interval x Element [0, 1].Solutionclear al Write a well-commented MATLAB script program to plot the function f(x) = Sigma^50_k=1 Squarerootk sin(2pi kx) on the interval x Element [0, 1].Solutionclear al](/WebImages/47/write-a-wellcommented-matlab-script-program-to-plot-the-func-1148179-1761617640-0.webp)