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 : What is single user sysytem What is

    What is meant by the single users system?

  • Q : Image reconstruction in CT using MATLAB

    What is Image reconstruction in CT using MATLAB?

  • Q : State De Morgans Theorem De Morgan's

    De Morgan's Theorem: The two rules which can help to simplify Boolean expressions comprising multiple logical-not operators in combination with the other Boolean operators.

  • Q : What is Process Process : It is an

    Process: It is an individual thread-of-control to which an execution time slice is assigned by the operating system.

  • Q : Define the term Binary Binary : This is

    Binary: This is the number representation in base 2. In base 2, only digits 0 and 1 are utilized. Digit positions symbolize successive powers of 2.

  • Q : Write a program using simple loop

    Objective:  The purpose of this problem is to gain experience with the principles necessary to write a program using simple loop, decision processing, counters and accumulators Save the Barns, a bi-partisan po

  • Q : What is an Unchecked exception

    Unchecked exception: An exception for which it is not needed to give a local try statement or to propagate through a throws clause stated in the method header. An exception which is not handled will cause program annihilation when it is thrown.

  • Q : Main uses of Virtual memory Illustrate

    Illustrate the main uses of Virtual memory?

  • Q : What is a Sub class Sub class : It is a

    Sub class: It is a class which extends its super class. The sub-class inherits all the members of its super class. All Java classes are the sub-classes of Object class, which is at the root of inheritance hierarchy.

  • Q : Explain Model-view pattern Model-view

    Model-view pattern: It is a pattern in which the representation of data (that is, the model) is kept separate from its visualization (that is, the view). These decoupling makes it simpler to change the underlying data representation, or give multiple

©TutorsGlobe All rights reserved 2022-2023.