Professional Documents
Culture Documents
All Progs
All Progs
All Progs
******************
X = [19.3
34.2
61.4
50.5
29.4
22.1
70.3
82.9
54.9
36.3
51.6;
82.4;
90.8;
59.1;
47.0];
explode = zeros(size(x));
[c,offset] = max(x);
explode(offset) = 1;
h = pie(x,explode);
colormap summer
textObjs = findobj(h,'Type','text');
oldStr = get(textObjs,{'String'});
val = get(textObjs,{'Extent'});
oldExt = cat(1,val{:});
Names = {'Product X: ';'Product Y: ';'Product Z: '};
newStr = strcat(Names,oldStr);
set(textObjs,{'String'},newStr)
val1 = get(textObjs, {'Extent'});
newExt = cat(1, val1{:});
offset = sign(oldExt(:,1)).*(newExt(:,3)-oldExt(:,3))/2;
pos = get(textObjs, {'Position'});
textPos = cat(1, pos{:});
textPos(:,1) = textPos(:,1)+offset;
set(textObjs,{'Position'},num2cell(textPos,[3,2]))
--------------*****----------------------------------------SINE COS (30 must be taken input) ## Attention MOIZ (2 progs here) if u do plot
(x,y) it wl only plot sine
## if u do plot (x,z) it wl only plot cos
=======================######====================
x = linspace(0,2*pi,30);
y = sin(x);
z = cos(x);
plot(x,y,x,z)
title('Figure: Sine and Cosine Wave')
===============########==================================
Fourier plot (Vm, T0 should be taken input) it wl plot only five components
-------------------*****----------------------syms an bn n v t Cn C0
%initialization
T0 = 0.4;
f0 = 1/T0;
Vm = 2;
n = [1:5]
v = Vm*cos(2*pi*f0*t)
%Actual signal
UNIT STEP FUNCTION ( the values in y shold be taken by input 13 values, and zero
s(1,18) remains as it is))
-----------------#########---------------------
clf;
n = -10:20;
or from -10 to 20
u=[zeros(1,10) 1 ones(1,20)];
uence
y=[3 2 4 9 7 8 10 11 12 5 8 10 12 zeros(1,18)];
r=u.*y;
stem(n,r);
xlabel('time independent n');
ylabel('Amplitude');
title('Unit Step Sequence');
axis([-10 20 0 15]);
%generate a vect
%generate the unit step seq
---------------------######-------------------IF u count there wil b six porgs. 2 (sine cos progs), fourier, exp, unit step, p
ie chart