SlideShare a Scribd company logo
MATLAB
LEC 2
ENG/Ahmed Atef
%s - print a string
%c - print a single character
%d - print a whole number
%f - print a floating point number
n - print a new line (go to the next line to continue printing)
t - print a tab
 - print a slash
%% - print a percent sign
http://www.cs.utah.edu/~germain/PPS/Topics/Matlab/fprintf.html
for i=1:10
disp(i)
end
for i=1:10
fprintf( '%f %d n',sqrt(i),i)
end
for x=0:pi/6:pi
fpirntf ('%0.3f %.2f n',sin(x),cos(x))
end
x=[0:pi/60:2*pi]
y=sin(x)
z=cos(x)
plot(x,y,'green .')
>Colour
Black
blue
cyan
green …
>Style
Single sign
pulse sign
circle
square
dianmond
+,>,.,-,--
,o,d,p,x,h
Ex:2
x=[0:pi/60:2*pi]
y=sin(x)
z=cos(x)
plot(x,y,'green -')
hold
plot(x,z,'blue -')
x=[0:pi/60:2*pi]y=sin(x)
z=cos(x)
plot(x,y,'green -',x,z,'blue -')
x=[0:pi/60:2*pi]
y=sin(x)
z=cos(x)
plot(x,y,'green -',x,z,'blue -')
legend('sing(x)','cos(x)')
grid on
xlabel('X Axis')
ylabel('Y Axis')
title('Graph test 2D')
Subplot(num of rows ,num of columns,box num)
Subplot(3 ,2,box num)
Box Num 2Box Num 1
Box Num 4Box Num 3
Box Num 6Box Num 5
x=[0:pi/60:2*pi];
y=sin(x);
z=cos(x);
subplot(3,2,1);
plot(x,y,'green -')
grid
subplot(3,2,4);
plot(x,z,'blue -')
grid
x=[-8:0.05:8]
y=x
r=sqrt(x.^2+y.^2);
z=sin(r)./r;
plot3(x,y,z,'m -');
title('3D Line Graph')
xlabel('X axis')
ylabel('Y axis')
zlabel('Z axis')
x=[-8:0.05:8]
y=x
[x,y]=meshgrid(x,y)
r=sqrt(x.^2+y.^2);
z=sin(r)./r;
mesh(x,y,z);
title('3D graph')
xlabel('X axis')
ylabel('Y axis')
zlabel('Z axis')
THANKS

More Related Content

DOCX
Euler method in c
PDF
Program to reflecta triangle
DOCX
Programa
DOCX
Tercer Punto
PDF
Creative Coding 1 - 2 Variables
DOCX
Faisal
DOCX
Dti2143 lab sheet 9
DOCX
Newton cotes method
Euler method in c
Program to reflecta triangle
Programa
Tercer Punto
Creative Coding 1 - 2 Variables
Faisal
Dti2143 lab sheet 9
Newton cotes method

What's hot (20)

PPT
Calc 3.6a
PPT
Transformations: Slots
TXT
Desproteger hoja excel
DOCX
Percent
PPTX
A1 3 linear fxns
DOCX
Assignmnt 4
PDF
Tmux quick-reference
PDF
Tmux cheatsheet
DOCX
Segundo Punto
PPTX
Dip 5 mathematical preliminaries
PPT
Graphing Linear Equations Lesson
PDF
PPT
Chirantan (java)
DOCX
2 d rotation
PDF
Introduction of VAE
PDF
【AI実装4】TensorFlowのプログラムを読む2 非線形回帰
PPT
Introduction matlab
DOCX
Dti2143 dam31303 lab sheet 5
Calc 3.6a
Transformations: Slots
Desproteger hoja excel
Percent
A1 3 linear fxns
Assignmnt 4
Tmux quick-reference
Tmux cheatsheet
Segundo Punto
Dip 5 mathematical preliminaries
Graphing Linear Equations Lesson
Chirantan (java)
2 d rotation
Introduction of VAE
【AI実装4】TensorFlowのプログラムを読む2 非線形回帰
Introduction matlab
Dti2143 dam31303 lab sheet 5
Ad

Similar to Matlab introduction (20)

PPT
Introduction to matlab
PDF
Assignment on Numerical Method C Code
PPTX
Csci101 lect05 formatted_output
PDF
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
DOCX
C tutoria input outputl
DOCX
Practicle 1.docx
PDF
BS LAB Manual (1).pdf
PPTX
MATLAB programming tips 2 - Input and Output Commands
PPTX
Python 04-ifelse-return-input-strings.pptx
DOCX
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
PDF
C Language Lecture 3
PDF
Data Structure using C
PDF
GNU Emacs Reference Card.pdf
PPTX
L25-L26-Parameter passing techniques.pptx
PDF
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
PDF
SATySFiのこれからの課題たち
PDF
Simple C programs
PPTX
C Programming Example
PDF
Functional Programming in F#
PPT
Cbasic
Introduction to matlab
Assignment on Numerical Method C Code
Csci101 lect05 formatted_output
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
C tutoria input outputl
Practicle 1.docx
BS LAB Manual (1).pdf
MATLAB programming tips 2 - Input and Output Commands
Python 04-ifelse-return-input-strings.pptx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
C Language Lecture 3
Data Structure using C
GNU Emacs Reference Card.pdf
L25-L26-Parameter passing techniques.pptx
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
SATySFiのこれからの課題たち
Simple C programs
C Programming Example
Functional Programming in F#
Cbasic
Ad

Recently uploaded (20)

PPTX
Welding lecture in detail for understanding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPT
Project quality management in manufacturing
PDF
Well-logging-methods_new................
PPT
Mechanical Engineering MATERIALS Selection
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
PPT on Performance Review to get promotions
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Welding lecture in detail for understanding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Project quality management in manufacturing
Well-logging-methods_new................
Mechanical Engineering MATERIALS Selection
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Foundation to blockchain - A guide to Blockchain Tech
PPT on Performance Review to get promotions
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
R24 SURVEYING LAB MANUAL for civil enggi
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
bas. eng. economics group 4 presentation 1.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf

Matlab introduction