THE CODE BELOW GIVES MULTIPLE PLOTS FOR A PLOT COMMAND, NEED A SINGLE PLOT
显示 更早的评论
I HAD EXPECTED THE CODE BELOW TO GENERATE A SINGLE PLOT BUT IT GENERATES THE NUMBER OF PLOTS EQUAL TO THE LENGTH OF THE INPUT VECTOR (t). Don't know what is wrong. % Function that calculates the ML by prompting the user for inputs function output =Gen_ML(t) %Accept the initial time value firstIndex =input('Enter first index:'); %Accept the final time value lastIndex = input('Enter last index:'); %Accept the value of first constant alpha a=input('Enter alpha vaule'); %Accept the value of the second constant beta b=input('Enter beta value'); %Accept the value of constant lambda one l1=input('Enter lambda one'); %Accept the value of constant lambda two l2=input('Enter lambda two'); t=firstIndex:lastIndex; for n=firstIndex:lastIndex output(n,:) = 0.0635*(t.^-0.6)* sum((l1*t.^a*n)/(gamma(n*a+b))) +0.0268*(t.^-0.6)* sum((l2*t.^a*n)/(gamma(n*a+b))) ; end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!