PARUL INSTITUTE OF TECHNOLOGY
ELECTRONICS AND COMMUNICATION ENGINEERING DEPARTMENT
OPEN ENDED PROBLEM
Name : PATEL JAY C Subject: SSA
Class : ME SEM-II Code : 2720501
Date : Er.No. : 140870705004
Aim: Write a MATLAB code to find mean square error.
Program:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
fontSize = 22;
xCenter = 12;
yCenter = 10;
% Make a timeline of 40 seconds with samples every 0.01 second.
t = 0 : 0.01 : 40;
% Let's say that there is 8 revolutions in that time.
numberOfRevolutions = 8;
% Produce the angles. They will go from 0 to numberOfRevolutions *
2*pi.
theta = linspace(0, numberOfRevolutions * 2 * pi, length(t));
radius = 5;
x = radius * cos(theta) + xCenter;
y = radius * sin(theta) + yCenter;
subplot(1,2,1);
plot(x, y, 'LineWidth', 3);
axis square;
xlim([0 20]);
ylim([0 20]);
grid on;
title('The circlular path it revolves around', 'FontSize', fontSize);
xlabel('X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
% m = -40;
% velocity = 0.25;
% ft = t;
% azimuth = 2 * 3.14 * ft/m;
% Plot azimuth (the y coordinate) as a function of time.
subplot(1,2,2);
plot(t, y, 'b-', 'LineWidth', 3);
grid on;
ylim([0, yCenter+radius]);
title('Height of a point as it revolves around', 'FontSize', fontSize);
xlabel('time', 'FontSize', fontSize);
ylabel('Y, or Azimuth', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
Output:
Conclusion:

Mean square error

  • 1.
    PARUL INSTITUTE OFTECHNOLOGY ELECTRONICS AND COMMUNICATION ENGINEERING DEPARTMENT OPEN ENDED PROBLEM Name : PATEL JAY C Subject: SSA Class : ME SEM-II Code : 2720501 Date : Er.No. : 140870705004 Aim: Write a MATLAB code to find mean square error. Program: clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all existing variables. workspace; % Make sure the workspace panel is showing. fontSize = 22; xCenter = 12; yCenter = 10; % Make a timeline of 40 seconds with samples every 0.01 second. t = 0 : 0.01 : 40; % Let's say that there is 8 revolutions in that time. numberOfRevolutions = 8; % Produce the angles. They will go from 0 to numberOfRevolutions * 2*pi. theta = linspace(0, numberOfRevolutions * 2 * pi, length(t)); radius = 5; x = radius * cos(theta) + xCenter; y = radius * sin(theta) + yCenter; subplot(1,2,1); plot(x, y, 'LineWidth', 3); axis square; xlim([0 20]); ylim([0 20]); grid on; title('The circlular path it revolves around', 'FontSize', fontSize); xlabel('X', 'FontSize', fontSize); ylabel('Y', 'FontSize', fontSize); % m = -40; % velocity = 0.25; % ft = t; % azimuth = 2 * 3.14 * ft/m; % Plot azimuth (the y coordinate) as a function of time. subplot(1,2,2); plot(t, y, 'b-', 'LineWidth', 3); grid on; ylim([0, yCenter+radius]); title('Height of a point as it revolves around', 'FontSize', fontSize); xlabel('time', 'FontSize', fontSize); ylabel('Y, or Azimuth', 'FontSize', fontSize); % Enlarge figure to full screen. set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
  • 2.