Structure consisting of the fields, MATLAB in Mathematics

Structure Consisting of the Fields

A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of the fields for x, y, & z. The separate solutions are symbolic expressions stored in the fields of structure.

>> solve('4*x-2*y + z=7' , 'x+ y+ 5*z=10' , '-2*x+ 3*y-z=2')

ans =

       x: [1x1  sym]

       y: [1x1  sym]

       z: [1x1  sym]

To refer to the separate solutions, that are in the structure fields, the dot operator is used.

>> x = ans.x

x =

124/41

>> y = ans.y

y =

121/41

>> z = ans.z

z =

33/41

The double function can therefore be used to convert the symbolic expressions to numbers, and store the outcomes from the three unknowns in a vector.

>> double([x y z])

ans =

       3.0244   2.9512   0.8049

Posted Date: 10/22/2012 6:50:02 AM | Location : United States







Related Discussions:- Structure consisting of the fields, Assignment Help, Ask Question on Structure consisting of the fields, Get Answer, Expert's Help, Structure consisting of the fields Discussions

Write discussion on Structure consisting of the fields
Your posts are moderated
Related Questions
Plot Functions: Faraway, we have plotted to generate two-dimensional plots and bar to generate bar charts. We have seen how to clear the Figure Window by using clf, and how to

Illustration of Logical vectors: Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements wer

Minimum and Maximum Value The MATLAB has built-in functions for numerous statistics. For illustration, min and max to find the minimum or maximum value in a data set. >> x

Sorting The Sorting is a process of putting a list in order; either in descending (maximum to minimum), or ascending (minimum to maximum) order. For illustration, here is a li

Plot types: Besides plot and bar, there are another plot types like stem plots, histograms, stem plots, area plots and pie charts, and also other functions which customize the

sprintf function: The sprintf function works precisely like the fprintf function, but rather than printing it generates a string. Here are some illustrations in which the outp

Program of built-in factorial function: Calling this function yields similar result as the built-in factorial function: >> fact(5) ans =   120 >> factorial(

Writing to Files: There are many lower level functions which can write to files. We will focus on the fprintf function that can be used to write a file and also to append to a

Complex numbers: A complex number is commonly written in the form z = a + bi here a is known as the real part of the number z, b be the imaginary part of z, and i is √-1

The variance is generally defined in terms of the arithmetic mean as: At times, though, the denominator is defined as n instead of n - 1. The default definition used by t