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!