Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need Matlab help please ...

Status
Not open for further replies.

Holaa

Newbie level 3
Newbie level 3
Joined
Mar 19, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,305
Hi Guys,

Can anybody help me to change my y-axis in matlab to (db) logarithmic..
part of my code looks like:


c=sqrt(abs(data:),2)).^2 + abs(data:),3)).^2);
b=data:),1);
tmp=folderContents(i,:);
plot(b,c,'red');

BUT: I do not want to choose some commands like semilogy, loglog ...etc
Tanks in advance for your help.......
 

Are you sure that "c" is always positive that is strictly > 0 (coming from a sqrt will not be negative for sure but it could be zero) ?
Sometimes also numbers very very close to zero (even if positive) could cause problems since generating huge numbers after the log function
 

Are you sure that "c" is always positive that is strictly > 0 (coming from a sqrt will not be negative for sure but it could be zero) ?
Sometimes also numbers very very close to zero (even if positive) could cause problems since generating huge numbers after the log function

yes, all of them are positive and near to this number 0.9923, 0.9933 .... etc
here is example::

0.9334
0.9331
0.9329
0.9326
0.9323
0.9321
0.9318
0.9315
0.9313
0.9310
0.9307
.
.
etc
 

OK, what do you mean exactly with "wrong plots". Did you get any error message ?
You can try to plot a small subset of data (f.i. the first 20 values), so you can also display each value and have a look if something strange appear.
Just an additional thing: as far as I remember log(x) is the logarithm in base "e"; to convert in dB you need instead the logarithm in base "10" so you have to use log10(x)
 

OK, what do you mean exactly with "wrong plots". Did you get any error message ?
You can try to plot a small subset of data (f.i. the first 20 values), so you can also display each value and have a look if something strange appear.
Just an additional thing: as far as I remember log(x) is the logarithm in base "e"; to convert in dB you need instead the logarithm in base "10" so you have to use log10(x)

Thanks alot for your answers :)

I mean with ""wrong plots" that I get something not expected and illogical. even that, I tried log10(x) but still same problem :-:)-(
 

Sorry, but I don't understand what you mean. Illogical with respect to what ?
Could you post more informations ? F.i. the plot you did and the expected one. Also if possible 10 values of the data vector leading to a "wrong" graph.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top