1

Using MATLAB Write a MATLA code to solve the following system of linear equations: -x +...

Question

Using MATLAB Write a MATLA code to solve the following system of linear equations: -x +...

Using MATLAB

3. Write a MATLA code to solve the following system of linear equations: 20y 3x 1z 3

Write a MATLA code to solve the following system of linear equations: -x + y + 4z = -2 20y + 3x - 1z = 3 3z + 2y + 6z - 3 = 0

Answers

Let's write the equations in simple form:

-x + y + 4z = -2

3x + 20y -z = 3

0x + 2y + 9z = 3

Following is the required code to solve the above problem.

% Matrix A contains the coefficients of the variables

A = [
-1 1 4
3 20 -1
0 2 9
]
  

% Matrix B contains the values at the Right Hand Side in the three equations
B = [ -2 ; 3 ; 3 ]

% compute the value for x, y, and z

solution = inv(A) * B

Here is a screenshot of the output for above code:

Default Term warning: function-/demo.m shadows a core library function -1 1 4 32?-1 2 9 2 solution = 3.29730 -0.32432 0.48541 sh-4.3$

Note: I was confused if the equations were correctly written. This is how they were in the question.

If you feel that the equations that i have written after simplifying doesn't match yours, please do COMMENT.

Hope this code meets all your requirements...

BEST WISHES!


Similar Solved Questions

1 answers
Question 14 (1 point) Which asset below is generally the most suitable benchmark measure of the...
Question 14 (1 point) Which asset below is generally the most suitable benchmark measure of the risk-free return? a) Small stocks Ob) Non-investment grade bonds c) Common stocks Od) Treasury bills e) Long-term government bonds...
1 answers
Suppose that James's income in Year 1 was $43,000. Over the next four years his income...
Suppose that James's income in Year 1 was $43,000. Over the next four years his income increases by 5% per year. At the same time. the economy experiences an inflation rate of 4% per year. a. Complete the table below. Do not round your intermedlate calculations. Enter your final responses as a w...
1 answers
Consider a monopolist with a marginal cost curve MC = 5 + Q who faces a...
Consider a monopolist with a marginal cost curve MC = 5 + Q who faces a demand curve P = 35 - .5*Q. Finally, assume that the production of this good also emits a per-unit externality of 7.5. That is, the marginal damage to third-parties is 7.5. What per-unit tax can the government levy upon the bus...
1 answers
Instructions Prepare the journal entries necessary to record issue of the new bonds and th nds...
Instructions Prepare the journal entries necessary to record issue of the new bonds and th nds and the refunding of the bonds. E14-14 (L01,2) (Entries for Redemption and Issuance of Bonds) On Jun with a par value of $800,000 due in 20 years. They were issued at 98 and we Because of lower interest ra...
1 answers
EEL3712 Logic Design Fall 2017 page 3 1. (11pts-2+2+2+3+2 (bonus)) Solve the following questions. a) Build...
EEL3712 Logic Design Fall 2017 page 3 1. (11pts-2+2+2+3+2 (bonus)) Solve the following questions. a) Build a 8-to-1 MUX from a number of 2-to-1 MUX(S) only. Please also give the logic equation for the 8-t0-1 MUX that you made. b) Build a 6-to-1 MUX from a number of 2-to-1 MUX(s) only. Please also gi...
1 answers
When working in an aged care facility it is important to be aware of the legal...
When working in an aged care facility it is important to be aware of the legal and ethical considerations and possible assessment tools relevant to the older person. For each area below, define and determine the legal aspects surrounding both the legislation or assessment tool and its relevance to t...
1 answers
Numework: Chapter 8 Homework Score: 0 of 1 pt 14 of 1 Text Problem 2.5a A...
numework: Chapter 8 Homework Score: 0 of 1 pt 14 of 1 Text Problem 2.5a A firm's cost curves are given in the following table. Complete the table. (Round your responses to two decimal places.) TC TFC TVC AVC ATC MC 45 450 4 5 6 7 8 9 10 97 113 123 142 172 204 244 292 348 4552 45 68 45 78 45 97 4...
1 answers
Match the species' conditions on the left with the proper movement behavior on the right Bees...
Match the species' conditions on the left with the proper movement behavior on the right Bees defend their rich hive resources from intruders Wandering albatross find sporadic access to fish across the ocean [Choose] [Choose] migratory territorial nomadic vagrant [Choose] Crocodiles consume dens...
1 answers
On April 1, 2020, Tulane Electronics enters into a contract to sell XPS computers to Precision...
On April 1, 2020, Tulane Electronics enters into a contract to sell XPS computers to Precision Equipment at $100,000, which is also the stand-alone selling price of the computers. Tulane will receive cash payment immediately. Delivery is scheduled for May 1, 2020. As part of the contract, Tulane off...
1 answers
Suppose a particle called a kaon is created by cosmic radiation striking the atmosphere. Randomized variables...
Suppose a particle called a kaon is created by cosmic radiation striking the atmosphere. Randomized variables c = 0.89 c t = 1.25 times 10^-8 s It moves by you at 0.89c, and it lives 1.25 times 10^-8 s when at rest relative to an observer. How long does it live, in seconds, as you observe it? Delta ...
1 answers
Write a brief report. You should add to your code a solution to the following user...
Write a brief report. You should add to your code a solution to the following user story: Make a random path generator that creates a path that goes through all the cities exactly once. For example, a random path might be 4, 2, 1, 3. Turn in your code, as well as some console output showing your cod...
1 answers
Complete the following reactions: OH CH OH BgCrgOy, H2SO4 E Cr207 H,804 CH OH AICI (b)...
Complete the following reactions: OH CH OH BgCrgOy, H2SO4 E Cr207 H,804 CH OH AICI (b) PCC CH2Cl2...
1 answers
The mean number of oil tankers at a port city is 15 per day. The port...
The mean number of oil tankers at a port city is 15 per day. The port has facilities to handle up to 17 oil tankers in a day. Find the probability that on a given​ day, (a) fifteen oil tankers will​ arrive, (b) at most three oil tankers will​ arrive, and​ (c) too many oil tan...
1 answers
What is the wavelength of electromagnetic energy that could excite an electron in a hydrogen atom...
What is the wavelength of electromagnetic energy that could excite an electron in a hydrogen atom from n=1 to n=3 energy levels? ΔE=-2.18 x 10-18 J ·(1/(n_f^2 )-1/(n_i^2 ))...
1 answers
Which website would you recommend if you were in charge of ensuring that mindful leaders have a good Website to get useful and scholarly information? and Why? write 400-500 words!
Which website would you recommend if you were in charge of ensuring that mindful leaders have a good Website to get useful and scholarly information? and Why? write 400-500 words!...
1 answers
Please answer all questions below. 3. Joe and Jill are graduate students in a lab studying...
Please answer all questions below. 3. Joe and Jill are graduate students in a lab studying the eukaryotic ribosome. Each has the task of using sedimentation to isolate one of the large subunits that make up the ribosome. A) If Jill is in charge of the 40S subunit (has an S of 40S), and Joe, the 60S...
1 answers
Molander Corporation is a distributor of a sun umbrella used at resort hotels. Data concerning the...
Molander Corporation is a distributor of a sun umbrella used at resort hotels. Data concerning the next month's budget appear below: Selling price per unit Variable expense per unit Fixed expense per month Unit sales per month $ 29 $ 17 $ 10,560 1,030 Required: 1. What is the company's margi...
1 answers
Campbell Supper Co. paid a $0.702 dividend per share in 2013, which grew to $0.86 in...
Campbell Supper Co. paid a $0.702 dividend per share in 2013, which grew to $0.86 in 2016. This growth is expected to continue. What is the value of this stock at the beginning of 2017 when the required return is 8.7 percent? (Round the growth rate, g, to 4 decimal places. Round your final answer to...

-- 0.057880--