My graph is blank.
1 次查看(过去 30 天)
显示 更早的评论
When I run the code I get an answer, but the plot always comes up blank, with a scale that does not match the output of the function.
clear
clc
k = 1:10
x = 0.1:0.1:1
bug = 0
for a = 1 : length(k)
this_k = k(a)
this_x = x(1:a)
bug = bug + sin((factorial(k).^2).*x)/factorial(k)
end
1 个评论
James Tursa
2016-11-18
编辑:James Tursa
2016-11-19
What plot? I don't see what you are trying to plot. And what is this code supposed to be calculating?
采纳的回答
Preethi
2016-11-21
编辑:Walter Roberson
2016-11-21
hi,
variable bug is not a vector its a scalar value so when you plot you try to plot the graph is blank.
initialize bug as array with zeros and then use in loop
bug =[bug,bug(a-1)+sin((factorial(k).^2).*x)/factorial(k)]
start for loop index from 2
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!