SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
In polar coordinates a two-dimensional vector is given by its radius and angle (r, theta). Write a
user-defined function that adds two vectors that are given in polar coordinates. For the function
name and arguments use Where A is a matrix with rows as number of vectors and columns as
rand theta. The output arguments are radius and angle of the result. Use the function to carry the
following additions:
Solution
Type the code as below in a matlab file with name 'addvecpol.m'
function [r th] = addvecpol(a)
x1=a(1,1)*cos(a(2,1)*pi/180);
y1=a(1,1)*sin(a(2,1)*pi/180);
x2=a(1,2)*cos(a(2,2)*pi/180);
y2=a(1,2)*sin(a(2,2)*pi/180);
x3=x2+x1;
y3=y2+y1;
r=sqrt(x3.^2+y3.^2);
th=atan(y3/x3)*180/pi;
output for a) is
r =
16.8451
th =
35.0215
output for b) is
r =
19.7048
th =
-67.4337
output for c) is
r =
10.6878
th =
-53.7622

Weitere ähnliche Inhalte

Ähnlich wie In polar coordinates a two-dimensional vector is given by its radius .pdf

INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
Devaraj Chilakala
 

Ähnlich wie In polar coordinates a two-dimensional vector is given by its radius .pdf (20)

Solution of matlab chapter 3
Solution of matlab chapter 3Solution of matlab chapter 3
Solution of matlab chapter 3
 
bobok
bobokbobok
bobok
 
Matlab1
Matlab1Matlab1
Matlab1
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocity
 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
 
4 R Tutorial DPLYR Apply Function
4 R Tutorial DPLYR Apply Function4 R Tutorial DPLYR Apply Function
4 R Tutorial DPLYR Apply Function
 
A brief introduction to apply functions
A brief introduction to apply functionsA brief introduction to apply functions
A brief introduction to apply functions
 
Python High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.pptPython High Level Functions_Ch 11.ppt
Python High Level Functions_Ch 11.ppt
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd Esa
 
gmrit-cse
gmrit-csegmrit-cse
gmrit-cse
 
Matlab Basic Tutorial
Matlab Basic TutorialMatlab Basic Tutorial
Matlab Basic Tutorial
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Computation Assignment Help
Computation Assignment Help Computation Assignment Help
Computation Assignment Help
 
Chap08alg
Chap08algChap08alg
Chap08alg
 
Chap08alg
Chap08algChap08alg
Chap08alg
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
 
130717666736980000
130717666736980000130717666736980000
130717666736980000
 
Computational Assignment Help
Computational Assignment HelpComputational Assignment Help
Computational Assignment Help
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
statistics assignment help
statistics assignment helpstatistics assignment help
statistics assignment help
 

Mehr von pooranmalsaini1968

Inflation in the developing country of Terbia has been rising over th.pdf
 Inflation in the developing country of Terbia has been rising over th.pdf Inflation in the developing country of Terbia has been rising over th.pdf
Inflation in the developing country of Terbia has been rising over th.pdf
pooranmalsaini1968
 

Mehr von pooranmalsaini1968 (19)

In recent years, the number of people who use the Internet to obt.pdf
 In recent years, the number of people who use the Internet to obt.pdf In recent years, the number of people who use the Internet to obt.pdf
In recent years, the number of people who use the Internet to obt.pdf
 
Jack and Jill went up a hill to fetch a pail of water. There was a 50.pdf
 Jack and Jill went up a hill to fetch a pail of water. There was a 50.pdf Jack and Jill went up a hill to fetch a pail of water. There was a 50.pdf
Jack and Jill went up a hill to fetch a pail of water. There was a 50.pdf
 
Kempe Corporations capital structure consists of 50,000 shares of c.pdf
 Kempe Corporations capital structure consists of 50,000 shares of c.pdf Kempe Corporations capital structure consists of 50,000 shares of c.pdf
Kempe Corporations capital structure consists of 50,000 shares of c.pdf
 
Jonas has 4 classical music CDs. 5 country music CDs, and 3 rock musi.pdf
 Jonas has 4 classical music CDs. 5 country music CDs, and 3 rock musi.pdf Jonas has 4 classical music CDs. 5 country music CDs, and 3 rock musi.pdf
Jonas has 4 classical music CDs. 5 country music CDs, and 3 rock musi.pdf
 
JNS Inc. recently paid a $1.00 annual dividend. The dividend is expec.pdf
 JNS Inc. recently paid a $1.00 annual dividend. The dividend is expec.pdf JNS Inc. recently paid a $1.00 annual dividend. The dividend is expec.pdf
JNS Inc. recently paid a $1.00 annual dividend. The dividend is expec.pdf
 
JetBlue revenue in 2002 was $635.2 million. By 2009, revenue had in.pdf
 JetBlue revenue in 2002 was $635.2 million. By 2009, revenue had in.pdf JetBlue revenue in 2002 was $635.2 million. By 2009, revenue had in.pdf
JetBlue revenue in 2002 was $635.2 million. By 2009, revenue had in.pdf
 
Jeff deposits 150 into a fund today and 215 ten years later. Interest.pdf
 Jeff deposits 150 into a fund today and 215 ten years later. Interest.pdf Jeff deposits 150 into a fund today and 215 ten years later. Interest.pdf
Jeff deposits 150 into a fund today and 215 ten years later. Interest.pdf
 
Information is given about a polynomial f(x) whose coefficients a.pdf
 Information is given about a polynomial f(x) whose coefficients a.pdf Information is given about a polynomial f(x) whose coefficients a.pdf
Information is given about a polynomial f(x) whose coefficients a.pdf
 
Italian energy concern Eni SpA agreed to annually purchase 2 billion .pdf
 Italian energy concern Eni SpA agreed to annually purchase 2 billion .pdf Italian energy concern Eni SpA agreed to annually purchase 2 billion .pdf
Italian energy concern Eni SpA agreed to annually purchase 2 billion .pdf
 
It cost a contractor $12,750 to manufacture their first unit. The c.pdf
 It cost a contractor $12,750 to manufacture their first unit. The c.pdf It cost a contractor $12,750 to manufacture their first unit. The c.pdf
It cost a contractor $12,750 to manufacture their first unit. The c.pdf
 
Is there a such thing as a set with exactly 1,000 subsets Why .pdf
 Is there a such thing as a set with exactly 1,000 subsets Why .pdf Is there a such thing as a set with exactly 1,000 subsets Why .pdf
Is there a such thing as a set with exactly 1,000 subsets Why .pdf
 
Is the group of planar rotations of a square isomorphic to Z4 or to t.pdf
 Is the group of planar rotations of a square isomorphic to Z4 or to t.pdf Is the group of planar rotations of a square isomorphic to Z4 or to t.pdf
Is the group of planar rotations of a square isomorphic to Z4 or to t.pdf
 
Is centralized drinking water treatment and distribution more or less.pdf
 Is centralized drinking water treatment and distribution more or less.pdf Is centralized drinking water treatment and distribution more or less.pdf
Is centralized drinking water treatment and distribution more or less.pdf
 
Investments in stocks that are expected to be held for the long t.pdf
 Investments in stocks that are expected to be held for the long t.pdf Investments in stocks that are expected to be held for the long t.pdf
Investments in stocks that are expected to be held for the long t.pdf
 
Involvement of the top officers in corporate crimes increases the pen.pdf
 Involvement of the top officers in corporate crimes increases the pen.pdf Involvement of the top officers in corporate crimes increases the pen.pdf
Involvement of the top officers in corporate crimes increases the pen.pdf
 
In multiple regression analysis, testing the global null hypothes.pdf
 In multiple regression analysis, testing the global null hypothes.pdf In multiple regression analysis, testing the global null hypothes.pdf
In multiple regression analysis, testing the global null hypothes.pdf
 
infinity 0 tn e-t d t = n!Solution apply inte.pdf
 infinity 0 tn e-t d t = n!Solution                     apply inte.pdf infinity 0 tn e-t d t = n!Solution                     apply inte.pdf
infinity 0 tn e-t d t = n!Solution apply inte.pdf
 
Inflation and Nominal Returns. Suppose the real rate is 3.2 percent a.pdf
 Inflation and Nominal Returns. Suppose the real rate is 3.2 percent a.pdf Inflation and Nominal Returns. Suppose the real rate is 3.2 percent a.pdf
Inflation and Nominal Returns. Suppose the real rate is 3.2 percent a.pdf
 
Inflation in the developing country of Terbia has been rising over th.pdf
 Inflation in the developing country of Terbia has been rising over th.pdf Inflation in the developing country of Terbia has been rising over th.pdf
Inflation in the developing country of Terbia has been rising over th.pdf
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Kürzlich hochgeladen (20)

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
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
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

In polar coordinates a two-dimensional vector is given by its radius .pdf

  • 1. In polar coordinates a two-dimensional vector is given by its radius and angle (r, theta). Write a user-defined function that adds two vectors that are given in polar coordinates. For the function name and arguments use Where A is a matrix with rows as number of vectors and columns as rand theta. The output arguments are radius and angle of the result. Use the function to carry the following additions: Solution Type the code as below in a matlab file with name 'addvecpol.m' function [r th] = addvecpol(a) x1=a(1,1)*cos(a(2,1)*pi/180); y1=a(1,1)*sin(a(2,1)*pi/180); x2=a(1,2)*cos(a(2,2)*pi/180); y2=a(1,2)*sin(a(2,2)*pi/180); x3=x2+x1; y3=y2+y1; r=sqrt(x3.^2+y3.^2); th=atan(y3/x3)*180/pi; output for a) is r = 16.8451 th = 35.0215 output for b) is r = 19.7048 th = -67.4337 output for c) is r = 10.6878 th = -53.7622