-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code has been compacted with functions
- Loading branch information
1 parent
a099fe2
commit 713b96e
Showing
5 changed files
with
153 additions
and
157 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,24 @@ | ||
function annot(voltData,x,y,xScale,yScale) | ||
% Write voltage labels of the selected constant voltage lines of x,y data | ||
% Works correctly if HOLD ON command is issued before calling this function | ||
|
||
% VOLTDATA is a cell array of voltage data | ||
% X is the VOLTDATA index of the x-axis | ||
% Y is the VOLTDATA index of the y-axis | ||
% XSCALE is the scale factor of the X data (default = 1) | ||
% YSCALE is the scale factor of the Y data (default = 1) | ||
|
||
if nargin == 3 | ||
xScale = 1; | ||
yScale = 1; | ||
end | ||
|
||
v = 0; | ||
for i = 1:12 | ||
v = v + 5; | ||
text(voltData{i}(end,x)./xScale, ... | ||
voltData{i}(end,y)./yScale, ... | ||
[num2str(v), ' V \rightarrow'], 'HorizontalAlignment', 'right') | ||
end | ||
|
||
end |
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,28 @@ | ||
function annot3(voltData,x,y,z,xScale,yScale,zScale) | ||
% Write voltage labels of the selected constant voltage lines of x,y,z data | ||
% Works correctly if HOLD ON command is issued before calling this function | ||
|
||
% VOLTDATA is a cell array of voltage data | ||
% X is the VOLTDATA index of the x-axis | ||
% Y is the VOLTDATA index of the y-axis | ||
% Z is the VOLTDATA index of the z-axis | ||
% XSCALE is the scale factor of the X data (default = 1) | ||
% YSCALE is the scale factor of the Y data (default = 1) | ||
% ZSCALE is the scale factor of the Z data (default = 1) | ||
|
||
if nargin == 4 | ||
xScale = 1; | ||
yScale = 1; | ||
zScale = 1; | ||
end | ||
|
||
v = 0; | ||
for i = 1:12 | ||
v = v + 5; | ||
text(voltData{i}(end,x)./xScale, ... | ||
voltData{i}(end,y)./yScale, ... | ||
voltData{i}(end,z)./zScale, ... | ||
[num2str(v), ' V \rightarrow'], 'HorizontalAlignment', 'right') | ||
end | ||
|
||
end |
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
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,21 @@ | ||
function voltagePlot(voltData,x,y,xScale,yScale) | ||
% Plot 3D lines of the selected constant voltage lines of x,y,z data | ||
% Works correctly if HOLD ON command is issued before calling this function | ||
|
||
% VOLTDATA is a cell array of voltage data | ||
% X is the VOLTDATA index of the x-axis | ||
% Y is the VOLTDATA index of the y-axis | ||
% XSCALE is the scale factor of the X data (default = 1) | ||
% YSCALE is the scale factor of the Y data (default = 1) | ||
|
||
if nargin == 3 | ||
xScale = 1; | ||
yScale = 1; | ||
end | ||
|
||
for i = 1:12 | ||
plot(voltData{i}(:,x)./xScale, ... | ||
voltData{i}(:,y)./yScale, 'k--') | ||
end | ||
|
||
end |
Oops, something went wrong.