MATLAB: Can someone help I have to submit these work on tuesday. I just start learning matlab Thanks in advance

Write a script to create a single coordinate system graphs of y1(t) = sin(t) and y2(t) = cos(t) for 0 ≤ t ≤ pi. Function y1(t) should be plotted in yellow with dotted line and y2(t) in black with dashed line. Change the line width to 3. After creating a chart, add the grid, scale the charts so they occupy the entire space of available drawing. Code:
Screenshot:
Create graphs of functions: x, x3, ex, e^(x^2 ) for 0 ≤ x ≤ 1 in linear scale. Add a legend. Code:
Screenshot:
x, x3, ex, e^(x^2 ) for 0 ≤ x ≤ 1 use a logarithmic scale on the y-axis (func. semilogy). Add a legend and place it on the left side at the bottom. Code:
Screenshot:
x, x3, ex, e^(x^2 ) for 0 ≤ x ≤ 1 use a logarithmic scale on both axes (loglog function). Instead of a legend, add text annotations. Code:
Screenshot:
Create a graph of the function y(t) = ln2 + t + t2 for 0 ≤ t ≤ 50. Scale the graph so that: 5 ≤ t ≤ 20 and 30 ≤ y ≤ 600. Add a title written with bold font. Axis labels should be written in italic. Code:
Screenshot:

Best Answer

Use linspace(), legend(), and plot(). Here's a generic sample that can help you get started. Adapt as needed.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 30;
% Create 500 points between -pi and 3*pi
x = linspace(-pi, 3*pi, 500);
% Make equation y = e^x
y1 = exp(-x);
% Make equation y = cos(2*pi*x/period)
period = 1.20;
y2 = cos(2*pi*x/period);
% Make equation y = e^x * cos(2*pi*x/period)
y3 = exp(-x) .* cos(2*pi*x/period); % Note, using .* not *
% Plot them.
plot(x, y1, 'b-', 'LineWidth', 2);
hold on;
plot(x, y2, 'r-', 'LineWidth', 2);
plot(x, y3, 'm-', 'LineWidth', 2);
% Make it fancy
title('y = e^x * cos(2*pi*x/period)', 'FontSize', fontSize);
xlabel('X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
grid on;
legend('blah', 'foo', 'snafu'); % Put whatever strings you want.
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'My Homework', 'NumberTitle', 'Off')
For x^2 you must use x.^2 because x is an array. It should be easy to do your homework with this example. More examples are in the help.