Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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

Answers (1)

Walter Roberson
Walter Roberson on 31 Jul 2017
fplot(f, [0,50])
Not 0:50

This question is closed.

Community Treasure Hunt

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

Start Hunting!