Info

此问题已关闭。 请重新打开它进行编辑或回答。

why do i got the axis x from 0 to 1 despite i wrote fplot (f,[0:50])

1 次查看(过去 30 天)
Please i need your help I want to run this code in commond window (Matlab) : 1/ssj(4,30) 2/f= @(x) ssj(4,x) 3/fplot(f,[0:50]) the problem is that,when plotting I got a figure where the axis x from 0 to 1 not from 0 to 50 like i wrote in the third line of code Can anyone help me please..and thanks in advance
knowing that the the file "ssj" is below :
function y= ssj(K,p)
p= 10^(p/10); rs = 0.1; %rs = p/100; ro = 2^(2*rs); f=0; for i=1:K s=(nchoosek(K,i)*((-1)^i))*((K-1-i*ro+i*ro*log(i*ro/(K-1)))/((K-1-i*ro)^2)); f=f+s; end f= f*(K-1)+1 y = f;
end

回答(1 个)

Walter Roberson
Walter Roberson 2017-7-31
fplot(f, [0,50])
Not 0:50

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by