Professional Documents
Culture Documents
We Are Using The Function To Plot The Graphs With Vertical Orientation
We Are Using The Function To Plot The Graphs With Vertical Orientation
We Are Using The Function To Plot The Graphs With Vertical Orientation
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)')
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