Skip to content

Commit 6cfc103

Browse files
Added matlab_for_beginners
1 parent e051eac commit 6cfc103

Some content is hidden

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

43 files changed

+632
-0
lines changed

matlab_for_beginners/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
3+
The best way to learn matlab programming is to go through the basics problems along with the code.
4+
It allows us to understand the matlab language in a better way.
5+
6+
This, matlab_for_beginners tutorial is divided into different parts. Just go one by one through each part.
7+
After completion of all parts you will have good basic knowledge of matlab.
8+
9+
All The Best.
10+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
author - Puneet Prakash Arya
2+
email - puneetarya66@gmail.com
3+
github - https://github.com/puneet-pr-arya
4+
5+
6+
7+
8+
"MATLAB" is a programming platform designed specifically for engineers and scientists.
9+
The heart of MATLAB is the MATLAB language, a matrix-based language allowing the most natural expression of computational mathematics.
10+
11+
12+
What can you do with MATLAB?
13+
14+
Using MATLAB, you can:
15+
16+
Analyze data
17+
Develop algorithms
18+
Create models and applications
19+
20+
21+
Matlab Advantages
22+
23+
(.) Implement and test your algorithms easily
24+
(.) Develop the computational codes easily
25+
(.) Debug easily
26+
(.) Use a large database of built in algorithms
27+
(.) Process still images and create simulation videos easily
28+
(.) Symbolic computation can be easily done
29+
(.) Call external libraries
30+
(.) Perform extensive data analysis and visualization
31+
(.) Develop application with graphics user interface
32+
33+
34+
Who uses MATLAB?
35+
36+
Millions of engineers and scientists in industry and academia use MATLAB.
37+
You can use MATLAB for a range of applications, including deep learning and machine learning,
38+
signal processing and communications, image and video processing, control systems, test and measurement,
39+
computational finance, and computational biology.
40+
41+
42+
With these tutorials, i would like to give all of you a basic idea of matlab so that all of you got familiar with the platform
43+
and can work on it in future.
44+
45+
Thank you and all the best.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
3+
This part-1 contains basics programs of matlab to make you familiar with the language.
4+
For better understanding the basics of the matlab programming,
5+
please go through the programs according the following
6+
sequence. Details of each the programs is given alongside:--
7+
8+
1- add.m ( addition of numbers)
9+
2- equal.m ( The meaning of "a = b" )
10+
3- math.m ( Basic math operations )
11+
4- equal_add.m ( The meaning of "a = b", continued )
12+
5- print.m ( Formatted output )
13+
6- formatted_output.m ( Formatted output continued )
14+
7- array.m ( Simple addition of array )
15+
8- individual_eL_add.m ( Extracting an individual element of an array )
16+
9- comment.m ( The use of comment)
17+
10- continuation.m ( Continuation to next line )
18+
11- intr_math_fun.m ( Intrinsic math functions and constants )
19+
12- nam_var.m ( Naming a variable )
20+
13- Plot a graph ( for making a quick plot)
21+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%%Addition
2+
a = 3;
3+
b = 5;
4+
c = a+b
5+
%%Output:8
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
%%Ex. 7 Arrays
2+
3+
4+
a = [3 6 7];
5+
b = [1 9 4];
6+
c = a + b
7+
8+
9+
%Output: 4 15 11
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
%%Ex. 9 Comment
2+
%
3+
% This program demonstrates how to "comment out"
4+
% a segment of code
5+
6+
A = 3;
7+
B = A*A;
8+
%
9+
% B = 2*B <--- This statement is not executed
10+
%
11+
C = A+B
12+
13+
14+
15+
%Output: c = 12
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
%%Ex. 10 Continuation to next line
2+
summation1 = 1 + 3 + 5 + 7 ...
3+
+ 9 + 11
4+
5+
6+
%Note: The three periods (...) allow continuation to the next line of commands. The two
7+
% lines in the above example are essentially one line of "summation1 = 1+3+5+7+9+11".
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
%%Ex. 2 The meaning of "a = b"
2+
3+
4+
%In Matlab and in any programming language, the statement "a = b" does not mean
5+
%"a equals b". Instead, it prompts the action of replacing the content of a by the
6+
%content of b.
7+
a = 3;
8+
b = a;
9+
b
10+
11+
%Output:3
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
%%Ex. 4 The meaning of "a = b", continued
2+
a = 3;
3+
a = a+1;
4+
a
5+
6+
%Output:4
7+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
%%Ex. 6 Formatted output
2+
a = 3;
3+
b = a*a;
4+
c = a*a*a;
5+
d = sqrt(a);
6+
fprintf('%4u square equals %4u \r', a, b)
7+
fprintf('%4u cube equals %4u \r', a, c)
8+
fprintf('The square root of %2u is %6.4f \r', a, d)
9+
10+
11+
%Output: 3 square equals 9
12+
% 3 cube equals 27
13+
% The square root of 3 is 1.7321

0 commit comments

Comments
 (0)