-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlipPol.m
40 lines (20 loc) · 834 Bytes
/
FlipPol.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function FlipPol(handles, varargin)
%Change the position of any single driver or node.
myCircuit = getappdata(gcf,'myCircuit');
idx = 1;
for i=1:length(myCircuit.Device)
if isa(myCircuit.Device{i},'QCASuperCell')
for j=1:length(myCircuit.Device{i}.Device)
if (strcmp(myCircuit.Device{i}.Device{j}.SelectBox.Selected,'on'))%check for device being on
myCircuit.Device{i}.Device{j}.Polarization = -1*myCircuit.Device{i}.Device{j}.Polarization;
end
end
else
if (strcmp(myCircuit.Device{i}.SelectBox.Selected,'on'))%check for device being on
myCircuit.Device{i}.Polarization = -1*myCircuit.Device{i}.Polarization;
end
end
end
myCircuit = myCircuit.CircuitDraw(0, gca);
setappdata(gcf,'myCircuit',myCircuit);
end