Top "Vector" questions

A vector is a single-dimensional array: it contains components that can be accessed using an integral index.

How to normalize a vector in MATLAB efficiently? Any related built-in function?

I normalize a vector V in MATLAB as following: normalized_V = V/norm(V); however, is it the most elegant (…

matlab vector performance
In C++ check if std::vector<string> contains a certain value

Is there any built in function which tells me that my vector contains a certain element or not e.g. …

c++ vector std stdvector
How to find common elements from multiple vectors?

Can anyone tell me how to find the common elements from multiple vectors? a <- c(1,3,5,7,9) b <- …

r vector r-faq
Replace an element into a specific position of a vector

I want to replace an element into a specific position of a vector, can I just use an assignment: // vec1 …

c++ visual-c++ vector stl insert
Why can't I make a vector of references?

When I do this: std::vector<int> hello; Everything works great. However, when I make it a vector …

c++ vector reference stl container-data-type
How do you copy the contents of an array to a std::vector in C++ without looping?

I have an array of values that is passed to my function from a different part of the program that …

c++ stl vector copy
Using arrays or std::vectors in C++, what's the performance gap?

In our C++ course they suggest not to use C++ arrays on new projects anymore. As far as I know …

c++ arrays vector
C# equivalent of C++ vector, with contiguous memory?

What's the C# equivalent of C++ vector? I am searching for this feature: To have a dynamic array of contiguously …

c# c++ vector
Convert a dataframe to a vector (by rows)

I have a dataframe with numeric entries like this one test <- data.frame(x = c(26, 21, 20), y = c(34, 29, 28)) How …

r dataframe vector r-faq
C++ delete vector, objects, free memory

I am totally confused with regards to deleting things in C++. If I declare an array of objects and if …

c++ vector delete-operator