A vector in MATLAB is a matrix with one row or one column. It's critical to understand the difference between row and column vectors. Many programming problems occur when a row vector is used instead of a column vector, and vice versa.
Square brackets [] are used to form column vectors, with semicolons or newlines used to divide elements. The transpose operator can be used to convert a row vector to a column vector (and vice versa).
The length of the greatest array dimension in X is returned by L = length(X). The length of a vector is just the number of elements. The length of an array with more dimensions is max(size(X)).
To make an array containing several elements in a single row, use a comma ',' or a space to separate the elements. A row vector is the name for this sort of array. To make an array with several elements in a single column, use semicolons ';' to divide the elements. A column vector is the name for this sort of array.
x = input(prompt) shows the prompt text and waits for the user to enter a value and press the Return key. The user can use variables in the workspace and enter equations like pi/4 or rand(3). Input returns an empty matrix if the user pushes the Return key without entering anything.
Learner's Ratings
4.7
Overall Rating
82%
9%
5%
0%
4%
Reviews
H
Habib Ullah
5
its a great job. i like it. thanks so much for this course.
H
Het PATEL
5
best video ever , thanks sir ,thanks learnvern
S
Souvik Poddar
5
excellent
A
Ayush Sinha
5
It's a great course, the curriculum is ideal. Very helpful too.
S
Sanjid Ahmed Sany
5
Excellent explanation sir.
S
Sanjid Ahmed Sany
5
Excellent explanation sir.
A
Akash Gupta
5
Excellent
N
Navin Kumar
5
Why payment processing time show technical difficulties.
Share a personalized message with your friends.