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
Code and decode a 32 bit long data for a specific user in CDMA if there is only 1 user and no noise.


Build a single phase model for the simple 3-phase system shown in the single line diagram shown below using SimPowerSystems in MATLAB Simulink. Data: Source Voltage

The Colon Operator: If the values in the vector are regularly spaced, the colon operator is used to iterate through these values. For illustration, 1:5 results in all the inte

#create a matlab GUI for designing common emitter amplifier which produces AC load lines based on the component values

clear tic L=1; T=0.2; nust=2000; dt=T/nust; n=40; dx=L/n;   r=1;  omega=10:10:5000;%Store Range of Frequencies for Simulation u=zeros(n+1,nust+1);%


hi i have this programm function [IRN,number ] = randnumbers( IRN ) IRN=int32(IRN) ITOTAL=(IRN*330)+100 ITOTAL=int32(ITOTAL); IQUOTIENT=ITOTAL/2303 IQUOTIENT=int32(IQUOTIENT);

1;write a matlab of geuss elimination with scaling and pivoting under consideration?

Generate a script: To generate a script, click File, then New, and then M-file. The new window will appear known as the Editor. To generate a new script, simply type the serie