Creating column vectors, MATLAB Programming

Creating Column Vectors:

One way to generate a column vector is by explicitly putting the values in square brackets, separated by the semicolons:

>> c = [1; 2; 3; 4]

c =

1

2

3

4

There is no other direct way to use the colon operator to get a column vector. Though, any row vector generated using any of these methods can be transposed to get a column vector. In common, the transpose of a matrix is a new matrix in which the rows and columns are interchanged.

For vectors, transposing a row vector results in a column vector, and transposing the column vector results in a row vector. The MATLAB has a built-in operator, the apostrophe, to obtain a transpose.

>> r = 1:3;

>> c = r

c =

1

2

3

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







Related Discussions:- Creating column vectors, Assignment Help, Ask Question on Creating column vectors, Get Answer, Expert's Help, Creating column vectors Discussions

Write discussion on Creating column vectors
Your posts are moderated
Related Questions
We wish to numerically perform the following integration: (a) Use Matlab's quad function to perform the above integral. (b) Analytically evaluate the integral (e.g. do t

Write a MATLAB program to find the undamped natural frequencies and modes of an electric car treating it as a four degree of freedom system. Determine the undamped natural frequenc

For the 66kV subtransmission network shown below, calculate the following, using a MATLAB Simulink Power System Blockset model: 1. Three phase, phase-to-phase and phase-to-earth

using newton divided diference formula find f(15) and f (8)

write a matlab program to calculate employee salary.

what is an error and its types

Create a custom chi-square function in matlab, MATLAB in Statisticsn..

clear clc %% DATA INPUT filename = input('Enter file name, including its extension: ', 's'); D = load(filename); %or load('Mphi.out'); %% %Trendline %Evaluates

Example of Printing vectors: For vectors & matrices, even though formatting cannot be specified, the disp function may be simpler to use in common than fprintf as it displays

1. Given these sinusoids: x 1 (t) = 0.5cos(25t+20°),   x 2 (t)=0.85cos(25t+160°) and   x 3 (t)= 0.81cos(25t-145°) (a)  Subplot the phasors X 1 , X 2 and X 3 corresponding t