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);

Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 26 Jul. 2015
Your are plotting one point

2 Kommentare

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 Kommentare

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);

Diese Frage ist geschlossen.

Produkte

Tags

Noch keine Tags eingegeben.

Gefragt:

am 26 Jul. 2015

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by