MATLAB Examples

This is an example of how to create an line plot with markers in MATLAB®.

Read about the plot function in the MATLAB documentation.

For more examples, go to MATLAB Plot Gallery

% Load Morse data
load MDdata dissimilarities dist1 dist2 dist3

% Plot the first set of data in blue
plot(dissimilarities, dist1, 'bo')
hold on

% Plot the second set of data in red
plot(dissimilarities, dist2, 'r+')

% Plot the third set of data in green
plot(dissimilarities, dist3, 'g^')

% Add title and axis labels
title('Morse Signal Analysis')

% Add a legend
legend({'Stress', 'Sammon Mapping', 'Squared Stress'}, ...
    'Location', 'NorthWest')