SlideShare una empresa de Scribd logo
1 de 13
MATLAB 7

LEC 1- INTRODUCTION
Command line

2+3=5, try 3*2,12,2^3,2/1(d),3-2
Inf,NAN try 0/1 1/0 13+inf 29/inf 0/0
a=2 a=2; try a*7 chk a try a = a*7 chk a
Squareroot=sqrt(4)
//sin(x),sin(x*pi/180) x = i/p in radians //
exp(x) try finding e and 1/e
date,calendar
Commands try to change environment

whos
what , why ,
clc-clear command window,clear - workspace



Functions usually return with a value
date ,help : functions
a,b scalars
x=0:10- vectors r generally ref as arrays
size(x) 1 row 11 columns,y=2.*x,z=y/2
Try and see what happens
x=0:0.1:10
z=sin(x)
plot(x,z),grid
 .1 ki jagah try .8 try sin(2*x)
Tan(x),ezplot(‘tan(x)’)
The TAB KEY HELP
x+2y=4,2x-y=3;
Matrix approach=
a=[1 2;2 -1];,b=[4;3];,x=ab;
x=2,y=1
Solve Function Approach=
[x,y]=solve(‘x+2*y=4’,’2*x-y=3’)
whos, workspace ko dekho
x = double(x), y= double(y)
whos
Function double converts x ( symbolic object
  data type to double array)
x+2*y % =4, 2*x –y % = 3 – Flag info on rt not
  part of command
help elfun,lookfor eigenvalue
magic square=magic(10)
n*n magic square has a row and column sum
  n(n^2 + 1)/2
contour(magic(22))
heights above sea level of points on maps
Mexican hat dekhne ki koshish karte hai

[x y] = meshgrid(-8:0.5:8);
r = sqrt(x.^2 + y.^2) + eps;
z = sin(r) ./ r;
 mesh(z);
surf(z), shading flat
surfc(z) meshc(z)
Handel’s Hallelujah chorus:
load handel
sound(y,Fs)
train,chirp,gong,laughter,splat

Earth’s view from space:
load earth
image(X);colormap(map);
Capital X kyun hai?????????
axis image

edit why

undock,dock current directory
M-file Introduction
C ki file likhte the turobo c me bas waisa hi hai bhidu
Idhar apan log matlab ka prog m file me likhenge



r – plot will be red

.m-script file or script
current directory test1
type test1

rt click,run,open,current directory folder
How a Program works in MATLAB?
Interpreter= command line = lang which computer
                               understands

Funda Simple hai : matlab ye ek interpreter hai!joh ap
  command line pe chalate ho who ye computer ko uski
  bhasha me samjha deta hai!

Iske piche ka ek aur imp funda ye hai ki matlab ek nos and
   RAM ka khel khelta hai!woh particular no RAM ke
   particular ek memory location me store karega

balance = 1000
no.1000 is allocated to mem location named balance in RAM
SUMMARY
MATLAB is a matrix-based computer system designed to
assist in scientific an engineering problem solving.


To use MATLAB, you enter commands and statements on
the command line in the Command Window. They are
carried out immediately.

quit or exit terminates MATLAB.

clc clears the Command Window.
help and lookfor provide help.


plot draws an x–y graph in a figure window.

grid draws grid lines on a graph.
exercise

Give values to variables a and b on the
command line, e.g. a = 3 and b = 5.
 Write some statements to find the sum,
difference, product and quotient of a
 and b.

Más contenido relacionado

La actualidad más candente

computer notes - Data Structures - 38
computer notes - Data Structures - 38computer notes - Data Structures - 38
computer notes - Data Structures - 38
ecomputernotes
 
08 recursive backtracking
08 recursive backtracking08 recursive backtracking
08 recursive backtracking
Omar Shahid
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answers
Sareen Kumar
 
Functions And Graphs Part 1
Functions And Graphs Part 1Functions And Graphs Part 1
Functions And Graphs Part 1
Timmathy
 
Lesson 4.1 Extreme Values
Lesson 4.1 Extreme ValuesLesson 4.1 Extreme Values
Lesson 4.1 Extreme Values
Sharon Henry
 
Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)
FahadYaqoob5
 
3.1 Extreme Values of Functions
3.1 Extreme Values of Functions3.1 Extreme Values of Functions
3.1 Extreme Values of Functions
Sharon Henry
 
A1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_solA1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_sol
malasumathi
 

La actualidad más candente (20)

computer notes - Data Structures - 38
computer notes - Data Structures - 38computer notes - Data Structures - 38
computer notes - Data Structures - 38
 
QUESTION 3 Write a program called Triangle.java which first reads in the (x,y...
QUESTION 3 Write a program called Triangle.java which first reads in the (x,y...QUESTION 3 Write a program called Triangle.java which first reads in the (x,y...
QUESTION 3 Write a program called Triangle.java which first reads in the (x,y...
 
08 recursive backtracking
08 recursive backtracking08 recursive backtracking
08 recursive backtracking
 
Loop Statements [5] M
Loop Statements [5] MLoop Statements [5] M
Loop Statements [5] M
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answers
 
matlab Lesson 1
matlab Lesson 1matlab Lesson 1
matlab Lesson 1
 
Elm
ElmElm
Elm
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Matlab
MatlabMatlab
Matlab
 
Functions And Graphs Part 1
Functions And Graphs Part 1Functions And Graphs Part 1
Functions And Graphs Part 1
 
Simplifying development-short - Mirco Dotta (Typesafe)
Simplifying development-short - Mirco Dotta (Typesafe)Simplifying development-short - Mirco Dotta (Typesafe)
Simplifying development-short - Mirco Dotta (Typesafe)
 
Computer notes - Sorting
Computer notes  - SortingComputer notes  - Sorting
Computer notes - Sorting
 
Java 8
Java 8Java 8
Java 8
 
Lesson 4.1 Extreme Values
Lesson 4.1 Extreme ValuesLesson 4.1 Extreme Values
Lesson 4.1 Extreme Values
 
Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)Lecture 12(point of inflection and concavity)
Lecture 12(point of inflection and concavity)
 
3.1 Extreme Values of Functions
3.1 Extreme Values of Functions3.1 Extreme Values of Functions
3.1 Extreme Values of Functions
 
I need some help implementing this in java using net beans. can anyone help ...
I need some help implementing this in java using net beans. can anyone help  ...I need some help implementing this in java using net beans. can anyone help  ...
I need some help implementing this in java using net beans. can anyone help ...
 
A1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_solA1 spyder variables_operators_nptel_pds1_sol
A1 spyder variables_operators_nptel_pds1_sol
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
 
14 arrays
14 arrays14 arrays
14 arrays
 

Destacado

Fb Nnew Pps
Fb Nnew PpsFb Nnew Pps
Fb Nnew Pps
Dear CD
 
An approach to implement model classes in zend
An approach to implement model classes in zendAn approach to implement model classes in zend
An approach to implement model classes in zend
swiss IT bridge
 

Destacado (20)

Michaelpritchard
MichaelpritchardMichaelpritchard
Michaelpritchard
 
Fb Nnew Pps
Fb Nnew PpsFb Nnew Pps
Fb Nnew Pps
 
Lec2
Lec2Lec2
Lec2
 
Michaelpritchard
MichaelpritchardMichaelpritchard
Michaelpritchard
 
Improving your driveway, path or patio.
Improving  your driveway, path or patio.Improving  your driveway, path or patio.
Improving your driveway, path or patio.
 
Logical vectors
Logical vectorsLogical vectors
Logical vectors
 
Matlab
MatlabMatlab
Matlab
 
VPN
VPNVPN
VPN
 
Tech tut
Tech tutTech tut
Tech tut
 
Matlab
MatlabMatlab
Matlab
 
Matlab graphics
Matlab graphicsMatlab graphics
Matlab graphics
 
Introduction into GIT
Introduction into GITIntroduction into GIT
Introduction into GIT
 
An approach to implement model classes in zend
An approach to implement model classes in zendAn approach to implement model classes in zend
An approach to implement model classes in zend
 
BarCamp in Saigon
BarCamp in SaigonBarCamp in Saigon
BarCamp in Saigon
 
SIB Green IT Policy
SIB Green IT PolicySIB Green IT Policy
SIB Green IT Policy
 
Los espacios en la BECREA. junta de andalucía.
Los espacios en la BECREA. junta de andalucía.Los espacios en la BECREA. junta de andalucía.
Los espacios en la BECREA. junta de andalucía.
 
Servicios tradicionales en la BECREA
Servicios tradicionales en la BECREAServicios tradicionales en la BECREA
Servicios tradicionales en la BECREA
 
How to apply Agile in Marketing
How to apply Agile in MarketingHow to apply Agile in Marketing
How to apply Agile in Marketing
 
GUÍA DE BIBLIOTECAS ESCOLARES. 6. Extensión cultural. Director: José García G...
GUÍA DE BIBLIOTECAS ESCOLARES. 6. Extensión cultural. Director: José García G...GUÍA DE BIBLIOTECAS ESCOLARES. 6. Extensión cultural. Director: José García G...
GUÍA DE BIBLIOTECAS ESCOLARES. 6. Extensión cultural. Director: José García G...
 
Client Satisfaction as engine of the continuous improvement
Client Satisfaction as engine of the continuous improvementClient Satisfaction as engine of the continuous improvement
Client Satisfaction as engine of the continuous improvement
 

Similar a Lec1

MATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docx
MATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docxMATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docx
MATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docx
andreecapon
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
Kurmendra Singh
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
bilawalali74
 

Similar a Lec1 (20)

Programming with matlab session 1
Programming with matlab session 1Programming with matlab session 1
Programming with matlab session 1
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
Matlab1
Matlab1Matlab1
Matlab1
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab ch1 intro
Matlab ch1 introMatlab ch1 intro
Matlab ch1 intro
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
MATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docx
MATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docxMATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docx
MATLAB sessions Laboratory 1MAT 275 Laboratory 1Introdu.docx
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Matlab booklet
Matlab bookletMatlab booklet
Matlab booklet
 
MatlabIntro (1).ppt
MatlabIntro (1).pptMatlabIntro (1).ppt
MatlabIntro (1).ppt
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
sol43.pdf
sol43.pdfsol43.pdf
sol43.pdf
 
Matlab
MatlabMatlab
Matlab
 
Mmc manual
Mmc manualMmc manual
Mmc manual
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

Lec1

  • 1. MATLAB 7 LEC 1- INTRODUCTION
  • 2. Command line 2+3=5, try 3*2,12,2^3,2/1(d),3-2 Inf,NAN try 0/1 1/0 13+inf 29/inf 0/0 a=2 a=2; try a*7 chk a try a = a*7 chk a Squareroot=sqrt(4) //sin(x),sin(x*pi/180) x = i/p in radians // exp(x) try finding e and 1/e date,calendar
  • 3. Commands try to change environment whos what , why , clc-clear command window,clear - workspace Functions usually return with a value date ,help : functions
  • 4. a,b scalars x=0:10- vectors r generally ref as arrays size(x) 1 row 11 columns,y=2.*x,z=y/2 Try and see what happens x=0:0.1:10 z=sin(x) plot(x,z),grid .1 ki jagah try .8 try sin(2*x) Tan(x),ezplot(‘tan(x)’) The TAB KEY HELP
  • 5. x+2y=4,2x-y=3; Matrix approach= a=[1 2;2 -1];,b=[4;3];,x=ab; x=2,y=1 Solve Function Approach= [x,y]=solve(‘x+2*y=4’,’2*x-y=3’) whos, workspace ko dekho x = double(x), y= double(y) whos Function double converts x ( symbolic object data type to double array)
  • 6. x+2*y % =4, 2*x –y % = 3 – Flag info on rt not part of command help elfun,lookfor eigenvalue magic square=magic(10) n*n magic square has a row and column sum n(n^2 + 1)/2 contour(magic(22)) heights above sea level of points on maps
  • 7. Mexican hat dekhne ki koshish karte hai [x y] = meshgrid(-8:0.5:8); r = sqrt(x.^2 + y.^2) + eps; z = sin(r) ./ r; mesh(z); surf(z), shading flat surfc(z) meshc(z)
  • 8. Handel’s Hallelujah chorus: load handel sound(y,Fs) train,chirp,gong,laughter,splat Earth’s view from space: load earth image(X);colormap(map); Capital X kyun hai????????? axis image edit why undock,dock current directory
  • 9. M-file Introduction C ki file likhte the turobo c me bas waisa hi hai bhidu Idhar apan log matlab ka prog m file me likhenge r – plot will be red .m-script file or script current directory test1 type test1 rt click,run,open,current directory folder
  • 10. How a Program works in MATLAB? Interpreter= command line = lang which computer understands Funda Simple hai : matlab ye ek interpreter hai!joh ap command line pe chalate ho who ye computer ko uski bhasha me samjha deta hai! Iske piche ka ek aur imp funda ye hai ki matlab ek nos and RAM ka khel khelta hai!woh particular no RAM ke particular ek memory location me store karega balance = 1000 no.1000 is allocated to mem location named balance in RAM
  • 11. SUMMARY MATLAB is a matrix-based computer system designed to assist in scientific an engineering problem solving. To use MATLAB, you enter commands and statements on the command line in the Command Window. They are carried out immediately. quit or exit terminates MATLAB. clc clears the Command Window.
  • 12. help and lookfor provide help. plot draws an x–y graph in a figure window. grid draws grid lines on a graph.
  • 13. exercise Give values to variables a and b on the command line, e.g. a = 3 and b = 5. Write some statements to find the sum, difference, product and quotient of a and b.