Matlap

Thread Starter

TAKYMOUNIR

Joined Jun 23, 2008
352
Rich (BB code):

close all;
clc;
w=0:.01:2*pi;
x=(1-(.25).^101 .* exp(-1i*101*w)).*(1-(1.5) .* exp(-1i*w))/((1-(.25).^exp(-1i*w)).*(1-(2/3) .* exp(-1i*w)));
magx=abs(x);
phax=angle(x).*180/pi;
subplot(2,1,1);plot(w,magx);
ylabel('magx');
xlabel('\omega,rad/sample');
subplot(2,1,2);plot(w,phax);
xlabel('\omega,rad/sample');
ylabel('phax');
Hi when i run the MATLAP i do not have any error message but i can not see waveform ,it is empty ,so what is the problem
thanks
 

tshuck

Joined Oct 18, 2012
3,534
What the heck is MATLAP!?:confused::confused::confused:

If, you meant a 'B' instead of a 'P', then you didn't do your dot-divide, see here:
Rich (BB code):
close all;
clc;
w=0:.01:2*pi;
x=(1-(.25).^101 .* exp(-1i*101*w)).*(1-(1.5) .* exp(-1i*w))./((1-(.25).^exp(-1i*w)).*(1-(2/3) .* exp(-1i*w)));
magx=abs(x);
phax=angle(x).*180/pi;
subplot(2,1,1);plot(w,magx);
ylabel('magx');
xlabel('\omega,rad/sample');
subplot(2,1,2);plot(w,phax);
xlabel('\omega,rad/sample');
ylabel('phax');
Since you can't really debug the code, it helps to split your assignments up into incremental assignments, e.g.
Rich (BB code):
close all;
clc;
w=0:.01:2*pi;
x1=(1-(.25).^101 .* exp(-1i*101*w)); % 1st part of numerator
x2 = x1 .*(1-(1.5) .* exp(-1i*w));  % second part of numerator
x3 = ((1-(.25).^exp(-1i*w)).*(1-(2/3) .* exp(-1i*w))); % denominator
x = x2 ./ x3; % do the division
magx=abs(x);
phax=angle(x).*180/pi;
subplot(2,1,1);plot(w,magx);
ylabel('magx');
xlabel('\omega,rad/sample');
subplot(2,1,2);plot(w,phax);
xlabel('\omega,rad/sample');
ylabel('phax');
 
Thread starter Similar threads Forum Replies Date
T Programming & Languages 1
T Homework Help 1
T Homework Help 1
E Programming & Languages 0
Top