Matlab plot (logarithmic) problem?

I am plotting the difference between two functions and the results is a vector (1x1000)

I have this function on the Y axis and (1:1000) on the X axis. but I would like to plot them in a logarithmic scale so I can see how the difference between these two functions better

I tried loglog and semiology and semilogx but I can't seem to get the result I want.

Update:

xsize=100;

xnum=1001;

dx=xsize/(xnum-1);

xi=0:dx:xsize;

analaticalD= 75*cos(15.*xi)-30*sin(10.*xi);

for i=1:xnum

if (i==1||i==xnum)

ff(i)=0;

else

ff(i)=(f(i+1)-f(i-1))/(2*dx);

end

end

L= [1 1 1 1 1; -2 -1 0 1 2; 2 0.5 0 0.5 2; -4/3 -1/6 0 1/6 4/3; 2/3 1/24 0 1/24 2/3];

R= [0,1,0,0,0];

S1=L\R';

S=S1./dx;

for i=1:xnum

if (i==1||i==xnum || i==2|| i==xnum-1)

ft(i)=0;

else

ft(i)=S(1,1)*f(i-2)+S(2,1)*f(i-1)+S(3,1)*f(i)+S(4,1)*f(i+1)+S(5,1)*f(i+2);

end

end

errorCF=analaticalD-ff;

errorCF4=analaticalD-ft;

now I want to draw both (errorCF and errorCF4 against xi) but on a logarithmic scale

I tried loglog and semiology but i keep getting the same plot

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.