Illustration of modifying elements, MATLAB Programming

Illustration of Modifying Elements:

Illustration, the fifth element in the vector newvec is 9

>> newvec(5)

ans =

9

The subset of a vector, that would be a vector itself, can also be achieved using the colon operator. For illustration, the following statement would get the fourth through sixth elements of the vector newvec, and store the result in the vector variable b:

>> b = newvec(4:6)

b =

7  9  3

Any vector can be used for the indices in the other vector, not merely one created using the colon operator. For illustration, the following would get the first, fifth, & tenth elements of the vector newvec:

>> newvec([1 5 10])

ans =

1  9  15

The vector [1 5 10] is termed as index vector; it indicates the indices in the original vector which are being referenced.

The value stored in a vector element can be changed by identifying the index or subscript. For illustration, to change the second element from the vector b to now store the value 11 rather than of 9:

>> b(2) = 11

b =

7  11  3

Posted Date: 10/18/2012 4:17:00 AM | Location : United States







Related Discussions:- Illustration of modifying elements, Assignment Help, Ask Question on Illustration of modifying elements, Get Answer, Expert's Help, Illustration of modifying elements Discussions

Write discussion on Illustration of modifying elements
Your posts are moderated
Related Questions

A filter described by the equation:    y(n) = x(n) + x(n-1) + 0.9 y(n-1) - 0.81 y(n-2) (a) Find the transfer function H(z) for the filter and find the poles and zeros of the fil

how can i write a programm about maze solver expert system only with if & then

Problem: Consider a trapezoidal piece of polymer film as shown below. The parallel sides of the trapezoid are insulated and the temperature of the bottom and diagonal sides are f

kind in geometric calculity in space AREA. >

how to find absolute value of a number

String Manipulation: The string in MATLAB software consists of any number of characters and is contained in the single quotes. Actually, strings are considered as vectors in w

This assignment deals with the combination of dynamic memory allocation and structures to create a common data structure known as a doubly-linked list, which is shown in Figure 1.

Constants: The variables are used to store values which can change, or that are not known ahead of the time. Most of languages also have the capacity to store constants that a

1;write the matlab of LU decomposion that can do any n*n matrix by considering scaling and pivoting?