Skip to content

Commit e744d00

Browse files
author
gulley
committed
Initial release
1 parent 2ca7fc4 commit e744d00

File tree

102 files changed

+748
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+748
-1
lines changed

Animator.prj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<MATLABProject xmlns="http://www.mathworks.com/MATLABProjectFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"/>

LICENSE.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2022, The MathWorks, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in
12+
the documentation and/or other materials provided with the distribution
13+
* Neither the name of the The MathWorks, Inc. nor the names
14+
of its contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
11
# Animator
2-
A tool for making GIF animation files from MATLAB® code.
2+
3+
Animator is a tool for making GIF animation files from MATLAB® code.
4+
5+
## Setup
6+
7+
Here's how it works.
8+
9+
1. Create an M-file that generates the plot that you want to animate.
10+
2. Indicate which parameter you want to change and how (this needs to be an assignment statement of the form "a = 1").
11+
12+
The Animator then manipulates your code and takes snapshots of the resulting plot. These snapshots are
13+
gathered into the GIF animation file and saved to disk.
14+
15+
For more information, look at the documentation files in the code/doc/ directory, especially GettingStarted.mlx
16+
17+
## MathWorks Products
18+
19+
Requires MATLAB release R2022a or newer.
20+
21+
## License
22+
23+
The license is available in the License file within this repository

ToolboxPackagingConfiguration.prj

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
2+
<configuration file="\\mathworks\devel\sandbox\gulley\github-enterprise\Animator\ToolboxPackagingConfiguration.prj" location="\\mathworks\devel\sandbox\gulley\github-enterprise\Animator" name="ToolboxPackagingConfiguration" target="target.toolbox" target-name="Package Toolbox">
3+
<param.appname>Animator</param.appname>
4+
<param.authnamewatermark>Ned Gulley</param.authnamewatermark>
5+
<param.email>gulley@mathworks.com</param.email>
6+
<param.company>MathWorks</param.company>
7+
<param.summary />
8+
<param.description />
9+
<param.screenshot>${PROJECT_ROOT}\img\membrane.png</param.screenshot>
10+
<param.version>1.0</param.version>
11+
<param.output>${PROJECT_ROOT}\Animator.mltbx</param.output>
12+
<param.products.name />
13+
<param.products.id />
14+
<param.products.version />
15+
<param.platforms />
16+
<param.guid>f7af5890-1f19-40be-a0c0-fe15693618cf</param.guid>
17+
<param.exclude.filters>% List files contained in your toolbox folder that you would like to exclude
18+
% from packaging. Excludes should be listed relative to the toolbox folder.
19+
% Some examples of how to specify excludes are provided below:
20+
%
21+
% A single file in the toolbox folder:
22+
% .svn
23+
%
24+
% A single file in a subfolder of the toolbox folder:
25+
% example/.svn
26+
%
27+
% All files in a subfolder of the toolbox folder:
28+
% example/*
29+
%
30+
% All files of a certain name in all subfolders of the toolbox folder:
31+
% **/.svn
32+
%
33+
% All files matching a pattern in all subfolders of the toolbox folder:
34+
% **/*.bak
35+
%
36+
resources/project/*
37+
.SimulinkProject/*
38+
_SimulinkProject/*
39+
resources/.Project/*
40+
resources/_Project/*
41+
**/*.prj
42+
**/.git
43+
img
44+
img/membrane.png
45+
releases
46+
test/smokeTest.m
47+
ToolboxPackagingConfiguration.prj</param.exclude.filters>
48+
<param.exclude.pcodedmfiles>true</param.exclude.pcodedmfiles>
49+
<param.examples />
50+
<param.demosxml />
51+
<param.apps />
52+
<param.registered.apps />
53+
<param.docs />
54+
<param.getting.started.guide>${PROJECT_ROOT}\code\doc\GettingStarted.mlx</param.getting.started.guide>
55+
<param.matlabpath.excludes />
56+
<param.javaclasspath.excludes />
57+
<param.exported.on.package>false</param.exported.on.package>
58+
<param.required.addons />
59+
<param.matlab.project.id>6a58ceb9-f693-4b14-8cb6-bd1362551145</param.matlab.project.id>
60+
<param.matlab.project.name>Animator</param.matlab.project.name>
61+
<param.release.start />
62+
<param.release.end />
63+
<param.release.current.only>false</param.release.current.only>
64+
<param.compatiblity.windows>true</param.compatiblity.windows>
65+
<param.compatiblity.macos>true</param.compatiblity.macos>
66+
<param.compatiblity.linux>true</param.compatiblity.linux>
67+
<param.compatiblity.matlabonline>true</param.compatiblity.matlabonline>
68+
<param.installation.map />
69+
<param.additional.sw.names />
70+
<param.additional.sw.licenses />
71+
<param.additional.sw.win.url />
72+
<param.additional.sw.mac.url />
73+
<param.additional.sw.linux.url />
74+
<unset>
75+
<param.summary />
76+
<param.description />
77+
<param.version />
78+
<param.output />
79+
<param.products.name />
80+
<param.products.id />
81+
<param.products.version />
82+
<param.platforms />
83+
<param.exclude.pcodedmfiles />
84+
<param.examples />
85+
<param.demosxml />
86+
<param.apps />
87+
<param.registered.apps />
88+
<param.docs />
89+
<param.matlabpath.excludes />
90+
<param.javaclasspath.excludes />
91+
<param.exported.on.package />
92+
<param.required.addons />
93+
<param.release.start />
94+
<param.release.end />
95+
<param.release.current.only />
96+
<param.compatiblity.windows />
97+
<param.compatiblity.macos />
98+
<param.compatiblity.linux />
99+
<param.compatiblity.matlabonline />
100+
<param.installation.map />
101+
<param.additional.sw.names />
102+
<param.additional.sw.licenses />
103+
<param.additional.sw.win.url />
104+
<param.additional.sw.mac.url />
105+
<param.additional.sw.linux.url />
106+
</unset>
107+
<fileset.rootdir>
108+
<file>${PROJECT_ROOT}\code</file>
109+
</fileset.rootdir>
110+
<fileset.rootfiles>
111+
<file>${PROJECT_ROOT}\code\animator.mlapp</file>
112+
<file>${PROJECT_ROOT}\code\doc</file>
113+
<file>${PROJECT_ROOT}\code\splitCode.m</file>
114+
<file>${PROJECT_ROOT}\code\sweep.m</file>
115+
</fileset.rootfiles>
116+
<fileset.depfun.included />
117+
<fileset.depfun.excluded />
118+
<fileset.package />
119+
<build-deliverables>
120+
<file location="${PROJECT_ROOT}" name="Animator.mltbx" optional="false">\\mathworks\devel\sandbox\gulley\github-enterprise\Animator\Animator.mltbx</file>
121+
</build-deliverables>
122+
<workflow />
123+
<matlab>
124+
<root>E:\jobarchive\Bmain\2022_10_21_h02m00s16_job2099115_pass\matlab</root>
125+
<toolboxes>
126+
<toolbox name="matlabcoder" />
127+
<toolbox name="embeddedcoder" />
128+
<toolbox name="gpucoder" />
129+
<toolbox name="fixedpoint" />
130+
<toolbox name="matlabhdlcoder" />
131+
<toolbox name="neuralnetwork" />
132+
<toolbox name="polyspacebugfinder" />
133+
</toolboxes>
134+
<toolbox>
135+
<matlabcoder>
136+
<enabled>true</enabled>
137+
</matlabcoder>
138+
</toolbox>
139+
<toolbox>
140+
<embeddedcoder>
141+
<enabled>true</enabled>
142+
</embeddedcoder>
143+
</toolbox>
144+
<toolbox>
145+
<gpucoder>
146+
<enabled>true</enabled>
147+
</gpucoder>
148+
</toolbox>
149+
<toolbox>
150+
<fixedpoint>
151+
<enabled>true</enabled>
152+
</fixedpoint>
153+
</toolbox>
154+
<toolbox>
155+
<matlabhdlcoder>
156+
<enabled>true</enabled>
157+
</matlabhdlcoder>
158+
</toolbox>
159+
<toolbox>
160+
<neuralnetwork>
161+
<enabled>true</enabled>
162+
</neuralnetwork>
163+
</toolbox>
164+
<toolbox>
165+
<polyspacebugfinder>
166+
<enabled>true</enabled>
167+
</polyspacebugfinder>
168+
</toolbox>
169+
</matlab>
170+
<platform>
171+
<unix>false</unix>
172+
<mac>false</mac>
173+
<windows>true</windows>
174+
<win2k>false</win2k>
175+
<winxp>false</winxp>
176+
<vista>false</vista>
177+
<linux>false</linux>
178+
<solaris>false</solaris>
179+
<osver>10.0</osver>
180+
<os32>false</os32>
181+
<os64>true</os64>
182+
<arch>win64</arch>
183+
<matlab>true</matlab>
184+
</platform>
185+
</configuration>
186+
</deployment-project>

code/animator.mlapp

33 KB
Binary file not shown.

code/doc/GettingStarted.mlx

1.24 MB
Binary file not shown.

code/doc/clock_demo.gif

299 KB
Loading

code/doc/clock_demo.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
% What time is it?
2+
t = linspace(0,2*pi,100);
3+
plot(cos(t),sin(t),'k')
4+
5+
% Draw the clock face
6+
for n = 1:12
7+
ang = pi/2 - n*2*pi/12;
8+
text(0.9*cos(ang),0.9*sin(ang),num2str(n), ...
9+
HorizontalAlignment="center", ...
10+
VerticalAlignment="middle")
11+
end
12+
13+
set(gcf,Color="white")
14+
axis equal
15+
axis off
16+
axis([-1 1 -1 1])
17+
18+
hr_hand = line([0 0],[0 1],LineWidth=6);
19+
min_hand = line([0 0],[0 1],LineWidth=2);
20+
21+
%%
22+
% What time is it?
23+
t = 3.5; % 1 .. 3
24+
25+
% Draw the hands
26+
m = 60*(t - floor(t));
27+
min_angle = pi/2 - m/60*2*pi;
28+
hr_angle = pi/2 - t/12*2*pi;
29+
30+
set(hr_hand, XData=[0 0.5*cos(hr_angle)],YData=[0 0.5*sin(hr_angle)])
31+
set(min_hand,XData=[0 0.8*cos(min_angle)],YData=[0 0.8*sin(min_angle)])

code/doc/logo_demo.gif

947 KB
Loading

code/doc/logo_demo.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
L = membrane(1,15);
2+
surf(L)
3+
4+
camlight
5+
shading flat
6+
axis vis3d
7+
axis off
8+
9+
azimuth = -40;
10+
elevation = 30;
11+
view(azimuth,elevation);

code/splitCode.m

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
function [sweepVar, startVal, sweepRange] = splitCode(codeLine)
2+
% splitCode - Divides the line of code into several parts
3+
% Expecting code of this form: "x = 12" or "x = 12 % 1..20"
4+
5+
sweepVar = "";
6+
sweepRange = [];
7+
startVal = [];
8+
9+
codeParts = regexp(codeLine,'=','split');
10+
if length(codeParts)~=2
11+
return
12+
end
13+
14+
% Strip all whitespace from the variable name
15+
sweepVar = stripWhitespace(codeParts{1});
16+
17+
remainder = codeParts{2};
18+
codeParts = regexp(remainder,'%','split');
19+
startVal = str2num(codeParts{1});
20+
if length(codeParts)~=2
21+
% No comment on this line
22+
return
23+
end
24+
25+
% Look for a range value
26+
remainder = codeParts{2};
27+
codeParts = regexp(remainder,'\.\.','split');
28+
if length(codeParts)==2
29+
sweepRange = [str2num(codeParts{1}) str2num(codeParts{2})];
30+
end
31+
32+
end
33+
34+
function strOut = stripWhitespace(strIn)
35+
% stripWhitespace - Removes all whitespace from a string
36+
strOut = regexprep(strIn,'\s','');
37+
end

0 commit comments

Comments
 (0)