Help with line graph plot
조회 수: 1 (최근 30일)
이전 댓글 표시
x = Timestep;
y = LogPriceReturn;
plot(x,y, '.'); hold on
title('Log Price Return');
xlabel('Timestep');
ylabel('Log Price Return');
axis([1 n -1 1]);
How can I change this code to plot this graph as a line graph instead of just displaying the points
댓글 수: 0
답변 (1개)
Star Strider
2016년 12월 6일
I assume the code you posted is in a loop. The most likely solution is something like this:
for loop_index = 1:last_value
... CODE ...
x(loop_index) = Timestep;
y(loop_index) = LogPriceReturn;
end
figure
plot(x,y)
title('Log Price Return')
xlabel('Timestep')
ylabel('Log Price Return')
axis([1 n -1 1])
grid
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Price and Analyze Financial Instruments에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!