Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
%% Plotting graphs in Matlab | ||
clear all | ||
close all | ||
|
||
|
||
%% Show two plots on different y-axes | ||
%% 250 data processed | ||
x1Vals = [2, 3, 4, 5, 6, 7]; | ||
y1Vals = [65, 56, 47, 44, 40, 39]; | ||
figure(1) | ||
yyaxis left | ||
plot(x1Vals, y1Vals, '-bd') | ||
xlabel('Number of Processors') | ||
ylabel('Processing time (s)') | ||
title('Processing time vs number of processors') | ||
|
||
|
||
%% 5,000 data processed | ||
x2Vals = [2, 3, 4, 5, 6, 7, 8]; | ||
y2Vals = [1560, 1077, 945, 838, 852, 725, 707]; | ||
figure(1) | ||
yyaxis right | ||
plot(x2Vals, y2Vals, '-rx') | ||
xlabel('Number of Processors') | ||
ylabel('Processing time (s)') | ||
title('Processing time vs number of processors') | ||
|
||
legend('250 Data', '5,000 Data') | ||
|
||
|
||
%% Show two plots on same y-axis | ||
%% Mean processing time | ||
y1MeanVals = y1Vals / 250; | ||
y2MeanVals = y2Vals / 5000; | ||
|
||
figure(2) | ||
plot(x1Vals, y1MeanVals, '-bd') | ||
hold on | ||
plot(x2Vals, y2MeanVals, '-rx') | ||
xlabel('Number of Processors') | ||
ylabel('Processing time (s)') | ||
title('Mean Processing time vs number of processors') | ||
legend('250 Data', '5,000 Data') |