Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Research Methodology PH798

Assignment #01

Submitted by: Syeda Awaisa Ali


Reg. ID: 200026
Semester: MSAP- 2nd (Physics)
Submitted to: Dr. Kamran

Contents:
• Introduction to Latex

• Structure of Latex Document

• Latex Example

• Introduction to Matlab

• Plotting in Matlab

• Labelling axis

• Legends

• Subplots

Introduction to Latex

• LaTeX is pronounced “lay-tech” or “lah-tech,” not “la-teks.”

• LaTeX is a high-quality typesetting system it includes features design for the production
of technical and scientific document.
• Most mathematicians and many other people use LaTeX to typeset papers, exams, books,
and more.

Why Use LaTeX?

•Designed by academics and easily accommodates academic use.

•Mathematical symbols and equations are easily integrated.

•Even complex structures such as footnotes, references, table of contents, and bibliographies can
be generated easily.

•It creates more beautiful documents.

•Portable, compatible, flexible, versatile, and cheap and free.

Installing LaTeX

•In Windows

•MiKTeX

–MiKTeX is a typesetting system for the Windows.

–Download from www.miktex.orgfor free

–It is generally recommended to install MiKTeX first, then an editor of your own choice.

•A text editor

–Such as Textmaker, Winshell, WinEdit (Not free).

–A text editor creates the source file (.texand others).

–It uses Texmakerwww.xm1math.net/texmaker/ which is free.

. Basic Structure of Latex Document:


Front matter:

a. Acknowledgement

b. Preface
c. foreword

d. Abstract (also called exclusive summary)

e. Table of content

f. list of figures

g. list of publications

Body:

a. parts of chapters text

b. sections and subsections

c. Graphics

d. Tables

e. Formulas

Back Matter:

a. Conclusions

b. Index

c. bibliography (references)

d. glossary
Example:

(Document class, title, text and equation writing using LaTex)

\document class [12 pt] {Article}

\begin document

\title{test document}

This is my first test document

\end document

\document class [12 pt] {Article}

\use package {ams math}

\begin document
\title {Test document}

This is my first test document

The equation of straight line is

\begin {equation}

y= mx+c

\end {equation}

The above example syntax will look like this

Footnotes/Quotes/Equations:
•\footnote {}

•\begin{quote} & \end{quote}

•` ’, `` ’’ for quotations

•Mathematical Equations

–Math always in between $ & $

•Alternatively, \begin{equation} & \end{equation}

–$ 1+4=5 $

–\frac{}{}, \sqrt{}, \sum_{k=1}^{n}

–^{}, _{}

–\greekletters (e.g. \alpha or \Alpha)


Citations:
•\cite{bibtexkey}, citeyear{bibtexkey}

•It is more convenient to create a bibliography file, called bibtexfile(.bib) and use it as needed.

•Most text editors are capable of creating a bib file, but there are more convenient tools out there.

•JabRef(http://jabref.sourceforge.net/)

Creating Graphics / Figures:


•Including a figure

\begin{figure}[htbp] %[Here Top Bottom Page(of floats)]

\centering %center the Figure

\include graphics[width=3.0in]{HeNeSetup} %Width and Filename

\caption{Diagram of equipment setup used for the HeNe laser test experiments} %Caption for
the figure

\label{fg:lasertest} %Label name for the figure, use this to reference it later.

\end{figure}

Including Equations:
•Including equations

\begin{align}

n_i\sin \theta _i= n_t\sin \theta _t \label{eq:snell}

\end{align}
TABLES:
•The code looks complicated

•End result looks very nice

•Very customizable you know the right commands

begin{table}[htbp]

\centering

\begin{tabular}{||l|cr|}

\hline

col 1 & col 2 & col 3 \\

\hline

\hline Column1 Column 2 Column 3

1 & 3 & 5 \\ 1 2 3

2 & 4 & 6 \\ a bdh this

\hline

\end{tabular}

\caption{Table Caption}

\label{tab:table_label}

\end{table}

Common Mistakes:
•Often times, you make a mistake when creating a document. You will notice the log file
reporting a problem.

•There are some common mistakes:

–“end” doesn’t follow “begin”

–$ doesn’t follow $
–Using commands from packages lot defined in the preamble

–Don’t forget “\”s.

Introduction to MATLAB:
MATLAB is a programming platform designed specifically for engineers and scientists.

The heart of MATLAB is the MATLAB language a metrix based language allowing the most
natural expression of computational Mathematics.

We can analyze data, Develop algorithms and can create models and applications using
MATLAB.

Millions of engineers and scientists in industry and academia use MATLAB. It can be used for a
range of application including deep learning and machine learning,Signal processing and
communications, Image and video processing, Control systems, Test and measurements and also
for Computational finance.

Plotting using MATLAB:


Syntax:
To plot example vectors and labeling axes as follows:

%syntax of simple plotting

clear all

x= [2,4,6,8,10]; %dependent vector of interest

y= [1, 3, 5, 7, 9]; %independent vector of interest

figure %create a new figure

plot(x,y)

title ('simple vector plotting') %title of out plot

% How to Label your Plot

xlabel('time t') %x label

ylabel('distance y') %y label


The result will be
LEGENDS:

You might also like