SlideShare a Scribd company logo
Assignment # 1 
Fall 2015 
Course title: STRUCTURED COMPUTER PROGRAMMING Course #: EE201 
Sections: All 
Name: Student #: 
Start MATLAB by either double clicking over the MATLAB icon on your desktop, or by selecting: Start menu → ALL Programs → MATLAB. 
You will at least 4 windows inside MATLAB; Command Window, Workspace, Current Folder and Command History. 
If you don’t see them all, click on Layout and select Default, as shown below: 
Khaled Mohammed Ali AL-awlaqi 1324593
Q1) In MATLAB command window, type the following: 
>> x = 2.5 
>> y = 2.5; 
>> A = [ 1 3 5 7] 
>> B = [ 2; 4; 6; 8] 
>> M = [ 1 3 5 7; 2 4 6 8] 
What is the effect of the semicolon? 
Q2) Write the suitable MATLAB help command to find out how to use the following symbols and functions in MATLAB: 
Mathematical operation 
Matlab help command 
√푎 
× 
푎푏 
sin−1(푥) 
|푦| 
Hint: help is used when you know the Matlab function and lookfor is used when you don’t know the Matlab function for the given operation. 
For example: help sin 
lookfor cosine x=2.5 store and display y = 2.5; store but don't display A = [ 1 3 5 7] store and display B = [ 2; 4; 6; 8] store but don't display M = [ 1 3 5 7; 2 4 6 8]store but don't display 
lookfor power 
lookfor multiply 
sqrt 
asin 
abs
Q3) Use MATLAB to compute the following mathematical expressions: 
Mathematical Expression 
MATLAB form 
Result 
푞= 2휋−5.4√3+√73 
푎= log10(123)− −34+12⁄ 
푊=1.5; 푟= cos−1푊+90√|2푊−푊2| 
푧= tan23휋 23+cos60° 
푘= 푐+푎 푏 푏+2푎 +푐 
Where a = 4; b = 5; c = -2; 
푚=104×ln푒√33 
푥=1;푦= −2 푛= sin(휋푥)22+푦2푥 
4+7푖 √|9−3푖| 
>>q=(2*pi-5.4)/sqrt(3)+7^(1/3) 
>>w=1.5; 
>> r=(acos(w)+90)/sqrt(abs(2*w-w^2)) 
>> a=log10(12^3)-(-3/4+(1/2)) 
>> z=(tan(3*pi/2))^2/3+cosd(60) 
m=10^4*log(exp(sqrt(33))) 
>>a=4; 
>> b=5; 
>> c=-2; 
>> k=(c+a)/b/(b+2*a)+c 
>>x=1; 
>> y=-2; 
>> n=sin(pi*x)^2/(2+y^(2*x)) 
>> b=(4+7i)/sqrt(abs(9-3i))

More Related Content

PDF
Epc test practical
DOCX
Bti1022 lab sheet 9 10
PPTX
Basic Algorithm @PPSC(1)
PPTX
Intro to MATLAB GUI
PDF
Assignements
PPTX
Flowcharts
PPTX
Flowchart and algorithm
DOC
Matlab tut2
Epc test practical
Bti1022 lab sheet 9 10
Basic Algorithm @PPSC(1)
Intro to MATLAB GUI
Assignements
Flowcharts
Flowchart and algorithm
Matlab tut2

What's hot (18)

PDF
Team AAA Pitch - Deeptech AI Hackathon
PPTX
Seminar 2 coding_principles
PPTX
Ex1 d sketchlinfuncs
PPTX
ANN ARIMA Hybrid Models for Time Series Prediction
PDF
17 Jo P May 08
PPT
Assignment problem
DOC
Matlab summary
PDF
Code Efficiency (Nur Nachman)
PDF
Matlab simulation project
PDF
Please show a screenshot of the code. Thank you. Solve the function F= 25x^2...
PDF
bpmn. Quadratic equation
PPTX
Assignment method
PPTX
Matlab - Introduction and Basics
PPT
lesson plan 1 maya 3
PDF
Simplified Scala Monads And Transformation - Harmeet Singh (Knoldus Inc.)
PPT
Matlab introduction
PDF
ECET350 Week 3 Homework Assignment
Team AAA Pitch - Deeptech AI Hackathon
Seminar 2 coding_principles
Ex1 d sketchlinfuncs
ANN ARIMA Hybrid Models for Time Series Prediction
17 Jo P May 08
Assignment problem
Matlab summary
Code Efficiency (Nur Nachman)
Matlab simulation project
Please show a screenshot of the code. Thank you. Solve the function F= 25x^2...
bpmn. Quadratic equation
Assignment method
Matlab - Introduction and Basics
lesson plan 1 maya 3
Simplified Scala Monads And Transformation - Harmeet Singh (Knoldus Inc.)
Matlab introduction
ECET350 Week 3 Homework Assignment
Ad

Viewers also liked (20)

PDF
EE201_Assignment3
PDF
EE201_Assignment4
PDF
02 atiqa ijaz khan 01
PDF
02 atiqa ijaz khan 02
PDF
02 atiqa ijaz khan 03
PDF
Applied statistics and probability for engineers solution montgomery && runger
PDF
Laut lepas 04
PDF
Launching
PPTX
Vapourcompressionrefrigeration 140614054320-phpapp02 (1)
PPTX
The mother we share - lyrics planning
PPTX
"Parla con Noi" - Realizzazione di un format televisivo
PDF
EDWARD ASKEW DJCV
PPTX
Prezentaciya vchitelya matematiki_chervonec_inni_oleksandrivni
PPT
Gig26
PPTX
Presentation5
PPTX
PDF
An pham day hoc du an
PDF
ApoOrv Garg_Resume_2015
DOCX
Rencana pelaksanaan pembelajaran 2013
PPTX
Bad Effects of Worrying
EE201_Assignment3
EE201_Assignment4
02 atiqa ijaz khan 01
02 atiqa ijaz khan 02
02 atiqa ijaz khan 03
Applied statistics and probability for engineers solution montgomery && runger
Laut lepas 04
Launching
Vapourcompressionrefrigeration 140614054320-phpapp02 (1)
The mother we share - lyrics planning
"Parla con Noi" - Realizzazione di un format televisivo
EDWARD ASKEW DJCV
Prezentaciya vchitelya matematiki_chervonec_inni_oleksandrivni
Gig26
Presentation5
An pham day hoc du an
ApoOrv Garg_Resume_2015
Rencana pelaksanaan pembelajaran 2013
Bad Effects of Worrying
Ad

Similar to Assignment1 (20)

PPT
Matlab practical and lab session
PPT
matlabchapter1.ppt
PPT
Introduction_to_Matlabbanmar k ibrahim a
PPT
Matlab introduction
PPTX
Intro to Matlab + GUI
PDF
MATLAB Basics-Part1
PPT
Matlab Tutorial.ppt
PPT
Matlab anilkumar
PPTX
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
DOCX
Mmc manual
PPTX
Introduction to matlab
PDF
Matlab ch1 intro
PDF
Image processing
PPTX
From zero to MATLAB hero: Mastering the basics and beyond
PPTX
presentation.pptx
PPTX
Basic of octave matlab programming language
PDF
PPT
Introduction to Matlab.ppt
PPTX
Raushan's MATLB PPT..pptx
PPTX
Matlab introduction
Matlab practical and lab session
matlabchapter1.ppt
Introduction_to_Matlabbanmar k ibrahim a
Matlab introduction
Intro to Matlab + GUI
MATLAB Basics-Part1
Matlab Tutorial.ppt
Matlab anilkumar
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
Mmc manual
Introduction to matlab
Matlab ch1 intro
Image processing
From zero to MATLAB hero: Mastering the basics and beyond
presentation.pptx
Basic of octave matlab programming language
Introduction to Matlab.ppt
Raushan's MATLB PPT..pptx
Matlab introduction

Assignment1

  • 1. Assignment # 1 Fall 2015 Course title: STRUCTURED COMPUTER PROGRAMMING Course #: EE201 Sections: All Name: Student #: Start MATLAB by either double clicking over the MATLAB icon on your desktop, or by selecting: Start menu → ALL Programs → MATLAB. You will at least 4 windows inside MATLAB; Command Window, Workspace, Current Folder and Command History. If you don’t see them all, click on Layout and select Default, as shown below: Khaled Mohammed Ali AL-awlaqi 1324593
  • 2. Q1) In MATLAB command window, type the following: >> x = 2.5 >> y = 2.5; >> A = [ 1 3 5 7] >> B = [ 2; 4; 6; 8] >> M = [ 1 3 5 7; 2 4 6 8] What is the effect of the semicolon? Q2) Write the suitable MATLAB help command to find out how to use the following symbols and functions in MATLAB: Mathematical operation Matlab help command √푎 × 푎푏 sin−1(푥) |푦| Hint: help is used when you know the Matlab function and lookfor is used when you don’t know the Matlab function for the given operation. For example: help sin lookfor cosine x=2.5 store and display y = 2.5; store but don't display A = [ 1 3 5 7] store and display B = [ 2; 4; 6; 8] store but don't display M = [ 1 3 5 7; 2 4 6 8]store but don't display lookfor power lookfor multiply sqrt asin abs
  • 3. Q3) Use MATLAB to compute the following mathematical expressions: Mathematical Expression MATLAB form Result 푞= 2휋−5.4√3+√73 푎= log10(123)− −34+12⁄ 푊=1.5; 푟= cos−1푊+90√|2푊−푊2| 푧= tan23휋 23+cos60° 푘= 푐+푎 푏 푏+2푎 +푐 Where a = 4; b = 5; c = -2; 푚=104×ln푒√33 푥=1;푦= −2 푛= sin(휋푥)22+푦2푥 4+7푖 √|9−3푖| >>q=(2*pi-5.4)/sqrt(3)+7^(1/3) >>w=1.5; >> r=(acos(w)+90)/sqrt(abs(2*w-w^2)) >> a=log10(12^3)-(-3/4+(1/2)) >> z=(tan(3*pi/2))^2/3+cosd(60) m=10^4*log(exp(sqrt(33))) >>a=4; >> b=5; >> c=-2; >> k=(c+a)/b/(b+2*a)+c >>x=1; >> y=-2; >> n=sin(pi*x)^2/(2+y^(2*x)) >> b=(4+7i)/sqrt(abs(9-3i))