Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
68 views
8 pages
Numerical Methods GroupNumber3 - Laboratory1
Numerical lab newton rhapson method
Uploaded by
Josh Barrios
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Numerical methods GroupNumber3_Laboratory1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
68 views
8 pages
Numerical Methods GroupNumber3 - Laboratory1
Numerical lab newton rhapson method
Uploaded by
Josh Barrios
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Numerical methods GroupNumber3_Laboratory1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 8
Search
Fullscreen
aS oes Name: Guiuan , Jhomel Y. snd Conditional Statements Mesina, Jomel B. coca ealod Rosales ,Roland A. jr Maglaqui, Andrei Miko Ye aa plaAltich Emil, ate Performed: Testor En Roaanel Anan Date Submitted: October 12, 2020 1. Objective(s): ay re oe matrices into MATLAB. ‘0 determine the sum of row, column and diagonal of a matrix usin, s , 1g MATLAB. 1.3 faa a matrix that has same sum of row, column and diagonal of different dimension using 2. Intended Learning Outcomes (ILOs): The students shall be able to: 2.1 Demonstrate scientific thinking and the ability to approach scientific resources intelligently. 2.2 Utilize MATLAB software in loops and conditional statements 23 Infer appropriate conclusions based upon the results of activity. 2.4 Reflect on personal transformation along the TIP graduate attributes, specifically, professional competence and critical thinking skils. 3. Discussion: We now consider how MATLAB can be used to repeat an operation many times and how decision are taken, We shall conclude with a description of a conditional loop structures are by necessity simplistic and, as well see, many of the commands can be reduced to a single line. The true power ‘of computers comes into play when we need to repeat calculations over and over again. In order to help you understand the commands in this activity, itis suggested that you work through the codes on paper. You should play the role of the computer and make sure that you only use values which are assigned at that time. Remember that computers usually ‘operate in a serial fashion and that they can only use a variable once it has been defined and given a value. This kind of thought process is very helpful when designing your own codes. The basic MATLAB loop command is for and it uses the idea of repeating an operation for all the elements of a vector.4. Procedure: LOOPING STATEMENTS EXAMPLE 1: In the following codes below displays a number “n” and its “n?” ooping.m N = input(* Input a number: *); for ii = 1:N disp({int2str(ii) ' squared equals ' int2str(ii*2)]) end | Write the output below displayed on the command window below n= n= 10 Lequared # equal 10 | | squared 1» eaves "0 1 uence gyi g 1 gqueee eq + | Wares, “acts ls squared equals & IS suqvared equals 2 JS squared equals 29 je caunee eaves 36) + Squarea eq vals WF a a cenig OF B Sqyarec ears OF & square eaves | We Sqeree equals (00 1. What is the meaning of "int 2stx*? ‘ " t sion tat pre woontng OF “ink acre tk is 8 Gunorion tna Teaue care a__String_inteqey formar a 1:N to ii = 2. What do you observed when you change ii i nuwver ES woe (eee oooeee eee end end 1. Write the output ofthe following when x = 5 when x =6 when x =9 wtber to b rember © bey pombee beer Number test x © 4 Divisible by x bivistole by © Divisivle Ly 7 Diviniohe by 4 Pie Ly & EXAMPLE 4. (Nested if-statements) The ideas behind nested if statements is made clear by the example below raining = input(‘Input 1 if it is raining, 0 if not’); if raining == 1 money available = input(‘ input money available: ‘); if money available > 20 disp([‘party’]) elseif money available > 10 disp({ ‘cinema’ ]) else disp({‘comedy night on telly’]) end else money_available = input(* input money available: ‘); temperature = input(* input temperature: ‘); if temperature > 70 & money_available > 40 disp({ ‘beach bbq’]) elseif money_available > 10 disp([‘beach’]) else disp([{‘you must be in UK]) endoO EXAMPLE 2: The following codes writes out the seven times table up to ten seven's str ‘times seven is ‘; for j = 1:10 x-743 disp((int2str(j) str intastr(x) 1) end Write the output below Lames 2 > bimes ita Himes > 1 a Fimes 2 1626 peme® ig 96 rise 9 ig 3 remes Fis ag Nemes 26 66 SOY Dew bime VG mes tie 30 CONDITIONAL STATEMENTS EXAMPLE 3: The following codes writes out the seven times table up to ten seven's str = ‘ Divisible by ‘7 \ x = input (‘Number to test: ")7 for j = 2:9 if rem(x,j) == 0 disp([str_int2str(j)])end 1. Write the output of the following when it is raining and your] When tis not raining and you | when it is not raining and the money available is 18 have no money available temperature is 100 and your money available is 20 Par hy ypu wth oe in VR Oineyna bean EXAMPLE 4. Write out the values of x2 for all positive integer x such that x° < 2000. To do this, we will use the code Panes output xe a 4 while x*3 < 2000 te as disp(x*2) 3G x=xtl; 4G end ty otExercises factors 4. Write a program on MATLAB that prints out the value ofthe integers from 1 to an integer (n) and their (Note: To calculate the prime factors of an integer we use the MATLAB command “factor” Code ksinput(‘enter the data/) disp(' factor’) disp(a) for n=1:length(a) if (a(n)>188mod(a(n), 2-0) a(n)=8.5*a(n); elseif (a(n)>1 && ‘Sample display enter the chat ie eacre Sample output ifn = 6, ‘The value of 6! Is equal to 720 2. Write a program on MATLAB which displays the value of an n factorial: input(‘the value of n: '); for fofti; end disp( ‘factorial is’) disp(f) Tre valve op gacrorial is +20 3. Construct a conditional statement which evaluates the function:SE 0, x<0 x, OsxSs1 (@)=)7 x, 1
2 Code Sample display et Gf x(i) <= 73 ag “4-8-2 oz ade y(i) = -x(4) -35 elseif (x(i) > -3) @& (x(i) < @) y(i) = x(i) + 35 elseif (x(i) > @) 8& (x(i) < 3) y(i) = -2#x(i) + 35 elseif x(i) >= 3 y(i) = @.5*x(4) - 4.53 end end plot (x,y) the following error messages: 1. Please enter a strictly positive integer 2. You entered zero 3. You failed to enter an integer 4. You entered a negative number 3. Write a code which asks the user for an integer and returns the prime factor of that integer and display Code Sample display5. Conclusion: a - 7 (WE COncwwoed nat anew sjou ewe feeling Camere wlim pe t", ee a nened Femene 6 We can ule NSIEE SP CREME for comin here Wo Ont peg eLOROMM GUNA! HOM CLEVE, ae tye J vor ie we Cm have an GG ele glatemtnt (ade enether IF KE fhatemeat }- ney Comei vena’ exeremenh EME Ha Tp Srobemen © yeu ui Rave gyenver wrtve) over Wha YOY Pragya eHto¥es Go souennl shehentny Lek SE PEST Yo CUAWENE aerer a COTE Condetton to EAPO Mat | 6. Assessment (Rubric for Activity Performance): IT oe BEGINNER “ACCEPTABLE PROFICIENT |/_ORITERIA fl A i Iscore| Activity Skills | [Work that usually needs to Jhave quality of work and __ [Provides work of the | |Quality of work |be checkediredone by [some small errors on the highest quality and answers {| lothers to ensure quality answer lare correct Focus on the [TOUPis rarely focused on |Group is focused on the [Group is consistently stays task |the task and what to be |task and what needs to be focused on the task and ldone ldone most of the time __|what needs to be done [Members do not Members occasionally Members always Process Skis [demonstrate targeted (demonstrate taryeted (demonstrate targeted | process stills. process skils. skills | [IL Work Habits Time [Members finish ahead of Management! [Members do not fish on _|Members finish on time with °° ath complete data Genco ime with incomplete data. incomplete data. Nee te fesiee de Members donot know their [Members have defined Members are on asks and cooperative and|@StS and have no defied Fesponstlis mest of he Pesponsbilies at all ines. jFogperatv® 24 responsiblties. Group ime. Groupconficts are [Group confit are Iconflicts have to be settled |cooperatively managed cooperatively managed at by the teacher. Imost of the time, at tres. (Clean and orderly Clean and orderly INeatness and [Messy workplace during workplace with occasional |workplace at al times lorderiiness [and afer the experiment. |mess during and after the |during and after the lexperiment. experiment. Abilty todo Members require Members require occasional| Members do not need to be renee Supervision by te teacher. |supervision by the teacher. |supervised by the teacher. [Other Comments / Observations: TOTAL SCORE Rating = (Total Score /21)
You might also like
Introduction To MATLAB Programming
PDF
No ratings yet
Introduction To MATLAB Programming
8 pages
Matlab PDF
PDF
100% (1)
Matlab PDF
34 pages
Assignment & Quiz (Matlab)
PDF
100% (1)
Assignment & Quiz (Matlab)
24 pages
Matlab Practical File
PDF
No ratings yet
Matlab Practical File
19 pages
Ass #1.0 Thermodynamics
PDF
No ratings yet
Ass #1.0 Thermodynamics
7 pages
Lab 2 Additional MATLAB Features, Properties of Signals and Systems, Convolution
PDF
No ratings yet
Lab 2 Additional MATLAB Features, Properties of Signals and Systems, Convolution
18 pages
Vikash Chandra - 13000119062
PDF
0% (1)
Vikash Chandra - 13000119062
44 pages
Ass #1 Thermodynamics
PDF
No ratings yet
Ass #1 Thermodynamics
7 pages
HW #1 Thermodynamics 1
PDF
No ratings yet
HW #1 Thermodynamics 1
7 pages
CH 1 SL1 Intro To Matlab
PDF
No ratings yet
CH 1 SL1 Intro To Matlab
25 pages
Control System Lab Manual
PDF
No ratings yet
Control System Lab Manual
52 pages
Matlab: Window, Where The Special Prompt Appears. This Prompt Means That MATLAB Is Waiting For A
PDF
No ratings yet
Matlab: Window, Where The Special Prompt Appears. This Prompt Means That MATLAB Is Waiting For A
20 pages
Session 7 PPT Loop
PDF
No ratings yet
Session 7 PPT Loop
20 pages
Prac t2: Matlab - Basics
PDF
No ratings yet
Prac t2: Matlab - Basics
21 pages
Numerical Technique Laboratory PDF
PDF
No ratings yet
Numerical Technique Laboratory PDF
56 pages
X (1 - 1 2 3) Max X (1) Min X (1) For I 1:length (X) If X (I) Max Max X (I) End End Disp (Max) Disp (Min)
PDF
No ratings yet
X (1 - 1 2 3) Max X (1) Min X (1) For I 1:length (X) If X (I) Max Max X (I) End End Disp (Max) Disp (Min)
7 pages
Laboratorysessi Onno.02: Geti Ntroducedwi Ththem Software
PDF
No ratings yet
Laboratorysessi Onno.02: Geti Ntroducedwi Ththem Software
6 pages
1: Variables in Matlab: Syntax
PDF
No ratings yet
1: Variables in Matlab: Syntax
9 pages
Digital Image Processing in Matlab
PDF
No ratings yet
Digital Image Processing in Matlab
42 pages
LABORATORY WORK 3 - EXERCISES 3 To 4
PDF
No ratings yet
LABORATORY WORK 3 - EXERCISES 3 To 4
9 pages
Lecture Note #7
PDF
No ratings yet
Lecture Note #7
71 pages
Chapter 2
PDF
No ratings yet
Chapter 2
16 pages
Numerical Computing Labmanual 70137777
PDF
No ratings yet
Numerical Computing Labmanual 70137777
66 pages
Pranjal 2
PDF
No ratings yet
Pranjal 2
16 pages
EDXC3103 Control System1
PDF
No ratings yet
EDXC3103 Control System1
21 pages
Pralay Mitra MATLAB
PDF
No ratings yet
Pralay Mitra MATLAB
40 pages
2305903-Sumit Experiment 1
PDF
No ratings yet
2305903-Sumit Experiment 1
4 pages
Chapter 5 Control Structures
PDF
No ratings yet
Chapter 5 Control Structures
8 pages
BRR Matlab
PDF
No ratings yet
BRR Matlab
37 pages
Operations Research I: Matlab Lab 02
PDF
No ratings yet
Operations Research I: Matlab Lab 02
29 pages
Signals and System Lab 1
PDF
No ratings yet
Signals and System Lab 1
11 pages
Reference Card MATLAB
PDF
No ratings yet
Reference Card MATLAB
4 pages
Matlab
PDF
No ratings yet
Matlab
72 pages
Lab Manual
PDF
No ratings yet
Lab Manual
30 pages
Lecture 4 - MATLAB Programming - Parts 2 and 3
PDF
No ratings yet
Lecture 4 - MATLAB Programming - Parts 2 and 3
60 pages
Matlab Tutorial
PDF
No ratings yet
Matlab Tutorial
50 pages
Lab 2 1
PDF
No ratings yet
Lab 2 1
12 pages
An Introduction To MATLAB: Based On MATLAB Tutorial by Math Works
PDF
No ratings yet
An Introduction To MATLAB: Based On MATLAB Tutorial by Math Works
8 pages
DSP Lab1 D
PDF
No ratings yet
DSP Lab1 D
24 pages
Mathematics 4330/5344 - # 3 Loops, Conditionals, Examples and Programming
PDF
No ratings yet
Mathematics 4330/5344 - # 3 Loops, Conditionals, Examples and Programming
11 pages
DIP TC-424 Manual Final
PDF
No ratings yet
DIP TC-424 Manual Final
55 pages
Control Statements in MATLAB: The Decision Making Control Statements Permit To Select and
PDF
No ratings yet
Control Statements in MATLAB: The Decision Making Control Statements Permit To Select and
34 pages
Advanced Matlab Programming: Flow Control
PDF
No ratings yet
Advanced Matlab Programming: Flow Control
38 pages
MATLAB Quick Reference: Operators
PDF
No ratings yet
MATLAB Quick Reference: Operators
12 pages
Matlab File - Deepak - Yadav - Bca - 4TH - Sem - A50504819015
PDF
No ratings yet
Matlab File - Deepak - Yadav - Bca - 4TH - Sem - A50504819015
59 pages
Industry 4.0 Lab.
PDF
No ratings yet
Industry 4.0 Lab.
35 pages
Matlab: A Brief Manual: I. Running Matlab B. Arrays
PDF
No ratings yet
Matlab: A Brief Manual: I. Running Matlab B. Arrays
6 pages
Help Commands - Name I.E Gives Help On How To Use A Command
PDF
No ratings yet
Help Commands - Name I.E Gives Help On How To Use A Command
4 pages
Introduction To Matlab For Experimental Physics
PDF
No ratings yet
Introduction To Matlab For Experimental Physics
34 pages
Matlab Commands
PDF
No ratings yet
Matlab Commands
6 pages
Experiment 02
PDF
No ratings yet
Experiment 02
12 pages
Matlab - Basics-VSC-2024 02 01
PDF
No ratings yet
Matlab - Basics-VSC-2024 02 01
37 pages
Introduction To Programming in MATLAB: 2 + 2 3 5 4 2 SQRT (9) Sin (Pi/2) Mod (7,3)
PDF
No ratings yet
Introduction To Programming in MATLAB: 2 + 2 3 5 4 2 SQRT (9) Sin (Pi/2) Mod (7,3)
7 pages
Matlab: Examples of Iterative Operations
PDF
No ratings yet
Matlab: Examples of Iterative Operations
20 pages
Chapter 7
PDF
No ratings yet
Chapter 7
14 pages
COMP1103 Week 5
PDF
No ratings yet
COMP1103 Week 5
23 pages
Matlabtalk 2
PDF
No ratings yet
Matlabtalk 2
43 pages
Matlab Talk
PDF
No ratings yet
Matlab Talk
43 pages
Intro - Matlab - and - Numerical - Method Lab Full Document
PDF
No ratings yet
Intro - Matlab - and - Numerical - Method Lab Full Document
75 pages
Matlab Tutorial For Computational Methods CE 30125: 4.1 The "If" Statement
PDF
No ratings yet
Matlab Tutorial For Computational Methods CE 30125: 4.1 The "If" Statement
9 pages
Why Is Calibration So Important
PDF
No ratings yet
Why Is Calibration So Important
1 page