my code output is right but my graph gives me nothing it's blank and I don't know why it wont work there are no error just gives a graph with nothing on it

1 Ansicht (letzte 30 Tage)
the fprintf's are correct its just the plot that won't work and the goal is to plot time on the x and stocks owned on the y which are the vectors called time and stock

Akzeptierte Antwort

VBBV
VBBV am 30 Nov. 2022
Bearbeitet: VBBV am 30 Nov. 2022
Use loop index
if Price(i) < buy
stock(i) = stock(i)+25; % use loop index
...
elseif sell < Price(i)
stock(i) = stock(i) - 50; % use loop index
else
stock(i) = stock(i)+0;
end

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements 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