We Are Using The Function To Plot The Graphs With Vertical Orientation

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

C2)

We are using the function to plot the graphs with vertical orientation.
MATLAB CODE:
x = 0:0.1*pi:2*pi;
a = cos (x);
subplot(2,1,1)
plot(a, 'LineWidth', 2)
legend('plot(a)')
title('a = cos(x)')
subplot(2,1,2)
plot(x, a, 'LineWidth', 2)
legend('plot(x, a)')

%there is no different in the fucntion graph, but for 2nd plot it is


%bounded by x, and first plot is not bounded.

Result:
Volume
Matlab Code

clear all
clc;
t = linspace(100,1000,5);
p = 100:200:1000;
R = 0.2870;
%A)

v = (R*t)/p
size(v)
%we get single output without using meshrid or dot operator withe size 1 1

%B
v = (R.*t)./p
size(v)
%using dot operator we get array output of same array location but for
%single value of one variable

%C)
[T,P] = meshgrid(t,p);
v = R.*T./P
size(v)

%using both dot and meshgrid output contain all the points in calculation
%with size 5 5
Matlab output

You might also like