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.

Help me to design graphics with Matlab

Status
Not open for further replies.

aemre

Newbie level 5
Joined
Dec 26, 2005
Messages
8
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,377
hi all...i have to design a graphic with matlab.....it s my homework and i need to make this immidiaetly..i wrote some codes but i couldn t see the graphic...

>> A=14,6;
B=365;
pa=(1:1:10);
gama=1/500;
Ud=(B*pa)/log((A*pa)/log(1+(1/gama)));
xlabel(pa);
ylabel(Ud);
plot(pa,Ud);

i have wrote this code.anyone can send me the truest one?so i will see my wrongs...thank u for all...pa changes 1 by 1 from 1 to 10 and changes 10 by 10 from 10 to 100...but i couldn t write this detail...please help me..(pa is a variable)
 

jakjoud

Full Member level 2
Joined
Feb 6, 2005
Messages
129
Helped
10
Reputation
20
Reaction score
1
Trophy points
1,298
Location
Marrakech
Activity points
954
Graphics with Matlab

Hi,
the Ud, is defined as a scalar. here is the truest script, I think so,
A=14.6;
B=365;
pa=(1:1:10);
gama=1/500;
Ud=(B.*pa)./log((A.*pa)./log(1+(1/gama)));
xlabel(pa);
ylabel(Ud);
plot(pa,Ud);
regards
 

aemre

Newbie level 5
Joined
Dec 26, 2005
Messages
8
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,377
Re: Graphics with Matlab

hi...thank you for your commands...but what are those points in the formula of Ud?
for example it is written as (B.*pa)./ it is going on like this...and how can i draw the graphic of Ud when pa is changing between 10 and 100..this must be in the same graphic..pa will come from 1 to 10 then from 10 to 100.but from 10 to 100 it will change 10 by 10...and again thank you very much,and thank you EDABOARD...
have good time with engineering and technicals...
 

dspman

Member level 2
Joined
Mar 14, 2004
Messages
42
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,288
Location
...
Activity points
336
Graphics with Matlab

hi,

the dotes positioned in the corrected program means that the operations should be done elemkent wise. it mean that for example the divition must be done on each element of the vector or matrix.
for the case you mentioned it is not clear that what you want to plot. if you want to plot your graph in logarithmic axes use semilogx!!

yours.
 

aemre

Newbie level 5
Joined
Dec 26, 2005
Messages
8
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,377
Re: Graphics with Matlab

thank u,but i am a very newer user of Matlab,so i don t know how to use logx????
can u give me an example?
thanks...
 

Roshdy

Member level 3
Joined
Nov 23, 2005
Messages
58
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Location
Egypt
Activity points
1,750
Re: Graphics with Matlab

no function with the name "logx" in the matlab
 

dspman

Member level 2
Joined
Mar 14, 2004
Messages
42
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,288
Location
...
Activity points
336
Graphics with Matlab

hi,
I'm so sorry.
I have made a mistake.
the correct command as I wrote above is semilogx.
so instead of plot you can use semilogx with the same arguments!!

yours.
 

Roshdy

Member level 3
Joined
Nov 23, 2005
Messages
58
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Location
Egypt
Activity points
1,750
Re: Graphics with Matlab

there is an example

x=0:10:1e6;
semilogx(x,log10(x));grid;
 

dspman

Member level 2
Joined
Mar 14, 2004
Messages
42
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,288
Location
...
Activity points
336
Graphics with Matlab

dear roshdy,

instead of
semilogx(x,log10(x))
you can use loglog(x,x) it plots the same as the above command,

yours.
 

Roshdy

Member level 3
Joined
Nov 23, 2005
Messages
58
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Location
Egypt
Activity points
1,750
Re: Graphics with Matlab

it is only to give an example to aemre
 

aemre

Newbie level 5
Joined
Dec 26, 2005
Messages
8
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,377
Re: Graphics with Matlab

thank u very much....i am indebuted you..

Added after 1 hours 2 minutes:

sorry....i have wanted to write indebted :) but i couldnt write....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top