I have two graphs, one is measurement (graph2), and one is result from the simulation (graph1). I need to plot them on one figure in Matlab but the problem is that graph1 has samples and graph2 has time value assigned to x-axis. How to make time from samples or samples from time to plot them on the same graph ?

This above picture is Graph1 and below is Graph2.

The time when they reach 0 is for:
graph1: x=3444
graph2: x=259
I think your problem is that one plot uses the indices to the samples as its
x-values, wheras the other uses actual times asx-values.You’ll have to scale the
x-axis to have bothx-axes describe to the same quantity. I don’t know the specifics of how you take samples, but here’s a simple example:Output:
Again, the specific implementation of how you should re-scale your x-data depends on specifics of your experiment. You’ll probably have to tinker a bit to get them to correspond.