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 view (last 30 days)
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

Accepted Answer

VBBV on 30 Nov 2022
Edited: VBBV on 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
stock(i) = stock(i)+0;

More Answers (0)


Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!