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
Use of string variables: The Characters involve letters of the alphabet, punctuation marks, digits, white space, and control characters. The Control characters are characters

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

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result


Animation: In this part we will observe a couple of ways to animate a plot. These are visuals, therefore the outcomes can't really be shown here; it is essential to type these

Three-dimensional pie and bar: For the bar3 function, x & y vectors are passed and the function displays three-dimensional bars as shown in figure: Figure: Three-dimen

Error-checking for integers: illustrations of running this script as shown below: >> readoneint Enter an integer: 9.5 Invalid! Enter an integer: 3.6 Invalid

Histogram: The histogram is a particular type of bar chart which shows the frequency of occurrence of the values within a vector. The Histograms use what are known as bins to

Illustration of Empty vectors: The Empty vectors can also be used to delete elements from the arrays. For illustration, to remove the third element from array, an empty vector

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