简体   繁体   中英

Plotting vectors with uneven axes in matlab

I'm struggling with a plot that I think is probably straightforward.

I'm running an algorithm with randomised inputs to find out how the error behaves as a function of the problem size, I need to plot a cumulative distribution at the end of it.

The structure of my code looks something like this:

for i=1:20:256
    for j=1:100
       MY ALGORITHM

    end
    errorThisTime = error
end
plot(errorThisTime)

I need to plot errorThisTime on an axis which goes from 0 to 256, but currently I can only get it to go up to 13 (the length of the errorThisTime vector).

How do I go about fixing this?

As Schorsch suggested, you must include dummy x-variable carrying respective values. Plotting this with respect to errorThisTime vector should solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM