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
You are to submit your completed MATLAB code and a short written report through the Blackboard upload facility as a single zip ?le. This zip ?le should consist of your ?nite volume

Simple Related Plot Functions: The other functions which are useful in customizing plots are the figure, clf, hold, leg-end, and grid. The short description of such functions

Illustration of a built-in function: The length function is an illustration of a built-in function which computes a single value; it returns the length of a vector. As an illu

Simulation of a transmission system with a 4-fsk modulation scheme; using non-coherent detection method and an awgn channel. System description: 1. Input: A. Random binary

Q. The steady-state circuit i(t) in a series RL circuit due to a periodic sawtooth voltage is given by where θ n = tan -1 (nω 0 L/R).With the parameters V A = 25 V, T 0

I need assignment to finish.

Generates sin or cos wave using plot functions: The script generates an x vector; iterating through all the values from 0 to 2*π in steps of 2*π /40 gives sufficient points to

Grid function: grid shows grid lines on the graph. Called by itself, it is a toggle which turns the grid lines on & off. Alternatively, the commands grid on & grid off can

can i getting wirless programing in matlab

please show me how this is coded in MATLAB