Geoscience Reference
In-Depth Information
% By Martin Trauth, June 27, 2014
%% Sine Wave
% We define a time vector t and compute the sine y1 of t.
% The results are displayed as linear 2D graph y1 against x.
x = 0 : pi/10 : 2*pi;
y1 = sin(x);
plot(x,y1)
title('My first plot')
xlabel('x-axis')
ylabel('y-axis')
%% Cosine Wave
% Now we compute the cosine y2 of the same time vector and
% display the results.
y2 = sin(x);
plot(x,y2)
title('My first plot')
xlabel('x-axis')
ylabel('y-axis')
%%
% The last comment is separated by the double percent sign
% without text. This creates a comment in a separate cell
% without a subheader.
We save the M-i le as myproject.m and click the Publish button in the Publish
To o l s t r i p. h e entire script is now evaluated and the Figure Windows pop
up while the script is running. Finally, a window opens up that shows
the contents of the published M-i le. h e document title and subheaders
are shown in a red font whereas the comments are in black fonts. h e i le
includes a list of contents with jump links to proceed to the chapters of the
i le. h e MATLAB commands are displayed on gray backgrounds but the
graphics are embedded in the i le without the gray default background of
Figure Windows. h e resulting HTML i le can be easily included on a course
or project webpage. Alternatively, the HTML i le and included graphics can
be saved as a PDF-i le and shared with students or colleagues.
Movie
2.6
2.12 Creating Graphical User Interfaces
Almost all the methods of data analysis presented in this topic are in the
form of MATLAB scripts, i.e., series of commands that operate on data
in the workspace (Section 2.8). Only in a few cases are the algorithms
implemented in functions such as canc for adaptive i ltering (Section 6.8) or
minput for digitizing from the screen (Section 8.7). h e MATLAB commands
provided by h e MathWorks, Inc., however, are mostly functions, i.e.,
algorithms with input and output variables. h e most convenient variants
Search WWH ::




Custom Search