-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangeClockField.m
34 lines (22 loc) · 1.14 KB
/
ChangeClockField.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
function ChangeClockField(handles)
%This function will change the clock field of the circuit, namely the
%electric field in the z direction. Once the clock field is strong enough
%in the negative z direction, this will allow nodes to get relaxed to a
%state of -1 or 1.
%
myCircuit = getappdata(gcf,'myCircuit');
newclockfield = str2num(get(handles.chngClock,'String'));
for i=1:length(myCircuit.Device)
if isa (myCircuit.Device{i},'QCASuperCell') %if any of the cells in a supercell are selected, the whole thing will be deleted
for j=1:length(myCircuit.Device{i}.Device)
myCircuit.Device{i}.Device{j}.ElectricField = [0 0 newclockfield];
end
else %any cell can be deleted also
myCircuit.Device{i}.ElectricField = [0 0 newclockfield];
end
end
% myCircuit = myCircuit.CircuitDraw(handles.LayoutWindow);
myCircuit.Device;
setappdata(gcf,'myCircuit',myCircuit);
Simulate(handles);
end