How do I compare two simulation files?

5 views (last 30 days)
Ali AlMuslih
Ali AlMuslih on 20 Nov 2022
Answered: William Rose on 21 Nov 2022
I have two files, each file contains one simulation, and each simulation contains 5 output results. I want to compare them in one plot for each result.
  1 Comment
William Rose
William Rose on 20 Nov 2022
@Ali AlMuslih, load both files and plot all 10 results on one plot, with different colors and line types. If the 5 results in file 1 and the five results in file 2 are "pairs" in some sense, then you might want to use the same 5 colors twice, but use solid lines for the file 1 results, and dashed lines for the file 2 results.

Sign in to comment.

Answers (1)

William Rose
William Rose on 21 Nov 2022
Here is an example of what I mean. I am attaching two files of simulated data, with 5 records , plus a column for time, in each file.
t1=data1(:,1); %time column from file 1
x1=data1(:,2:6); %5 columns of results from file 1
t2=data2(:,1); %time column from file 2
x2=data2(:,2:6); %5 columns of results from file 2
%Plot data
grid on; hold on;
Try it.


Find more on Simulation 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!

Translated by