please can any one help me i whrite this code to plot a figure but it give me an empty one ?

ti=40;
tb=320;
alpha=ti/tb;
k=256 ;
N=100;
peff= k/(N*(1-(1/N))^(1-k)) - k + (N*(1-(1/N)))*(alpha-1) ;
plot(peff);

Answers (2)

Your are plotting one point

2 Comments

If N=1:100
ti=40;
tb=320;
alpha=ti/tb;
k=256 ;
N=1:100;
peff= k./(N.*(1-(1./N)).^(1-k)) - k + (N.*(1-(1./N)))*(alpha-1) ;
plot(peff);
The plot is not empty. Changing the plot call in your code to:
plot(peff, 'bp')
will demonstrate this. You need to define your variables as vectors. Since I don’t know what you want to do, this is the closest I can come to a solution.

3 Comments

i want to o plot peff = f(N) where N varies from 1 to 100
It’sz not a very interesting plot, but this seems to work:
ti=40;
tb=320;
alpha=ti/tb;
k=256 ;
N=1:100;
peff= k./(N.*(1-(1./N)).^(1-k)) - k + (N.*(1-(1./N))).*(alpha-1) ;
plot(peff);

This question is closed.

Products

Tags

No tags entered yet.

Asked:

on 26 Jul 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!