Is it possible to assign a bidimensional array to a vector? I need to meshgrid 2 unidimensional array to obtain 2 bidimensional array. I can work just with vector. but when I have to meshgrid I don t know how it works.

Example:

Using arrays I can do it, but I need to do with vectors. Thanks to help evenctuallyCode:vector<double>x(cols); vector<double>y(rows); vector<double>X(rows*cols); vector<double>Y(rows*cols); for(int i=0;i<cols;i++){ for(int z=0;z<rows;z++){ X[i][z]=x[i]; //error Y[i][z]=y[z]; //error } }