Problem on linear equations using Matlab

Use Matlab to solve the following system of linear equations:

2x + y + 3z = 1
2x + 6y + 8z = 3
6x + 8y + 18z = 5

Capture Matlab code and the result in a text file.

E

Expert

Verified

Calculations:

% The equations represent AX = B . where A is the 3*3 Matrix of the input

% values , X is the matrix representing the variables and B is the result

% matrix; Thus we need to find X,which = b* inverse(a) or B/A

A= [ 2 1 3; 2 6 8; 6 8 18];
B= [ 1 3 5];
X= B/A;

% result of x, y, z displayed

x= X(1)
y=X(2)
z=X(3)

% results written in a text file

csvwrite('result.txt',X);

% Content of the text file displayed

type result.txt

   Related Questions in Programming Languages

  • Q : Generate source code for an ASP.NET Web

    What is the possibility to generate the source code for an ASP.NET Web service by a WSDL? Answer: The Wsdl.exe tool (as .NET Framework SDK) can be utilized to genera

  • Q : Special set of tags in PHP Normal 0

    Normal 0 false false

  • Q : Explain Mutator method Mutator method :

    Mutator method: It is a method specifically designed to permit controlled modification of a private attribute of a class. By convention, we name the mutators with a set prefix obeyed by the name of the attribute being transformed. For example, the mut

  • Q : Explain the relationship between XHTML

    Explain the relationship between XHTML and SGML.

  • Q : State HyperText Transfer Protocol

    HyperText Transfer Protocol: The HyperText Transfer Protocol (abbreviated as HTTP) is a set of rules stated to enable a Web client (that is, browser) to interact with the Web server.

  • Q : Are you sure that XHTML element name

    Are you sure that XHTML element name case sensitive? Answer: XHTML element names surely are case sensitive. Every element names should be written within lower case l

  • Q : Explain Out-of-bounds value

    Out-of-bounds value: It is a redundant value employed to point out that a different action from the norm is needed at some point. The read technique of InputStream returns -1 to point out that the end of a stream has been reached, for illustration, ra

  • Q : Explain the way to back-up active

    Explain the way to back-up active directory.

  • Q : Define Delegation Delegation : The

    Delegation: The procedure by which an object passes on a message has received to a sub-ordinate object. When inheritance is not accessible in a programming language, then delegation is the most viable option for ignoring code duplication and promoting

  • Q : Is it possible to encode mathematics

    Is it possible to encode mathematics using XML?

©TutorsGlobe All rights reserved 2022-2023.