Help with line graph plot

1 Ansicht (letzte 30 Tage)
MK96
MK96 am 6 Dez. 2016
Beantwortet: Star Strider am 6 Dez. 2016
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

Antworten (1)

Star Strider
Star Strider am 6 Dez. 2016
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

Kategorien

Mehr zu Price and Analyze Financial Instruments finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by