How to plot a function, instead of just values?
이전 댓글 표시
function y = fresnelS(f,x,n)
Where the function is defined as follows...
What would you add to the code so that you could plot f?
But instead of getting a list of values I want it to produce a graph.
댓글 수: 1
Stephen23
2019년 3월 8일
Original function:
function y = fresnelS(f,x,n)
if mod(n,2) == 1
error('The number of strips must be even!');
end
h = x./n;
y = f(x);
for k = 1:2:n
y = y + 4*f(k*h);
end
for k=2:2:n-1
y = y + 2*f(k*h);
end
y = y.*h/3;
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
