converting 3 arrays into matrix
Ältere Kommentare anzeigen
i have 3 different arrays x,y and z and i would like to create one matrix M where the M(i,j)=z(i) and i and j in M are the corresponding x and y values.
Note that x and y are not whole numbers
1 Kommentar
Jon
am 8 Jul. 2019
I'm sorry, but I am having difficulty understanding your verbal description of your problem. Please provide a simple example with arrays x,y,and z and the matrix M that you would like to produce.
Akzeptierte Antwort
Weitere Antworten (1)
It sounds like you want to horizontally concatenate three column vectors of equal length to form a matrix. If this doesn't demonstrate your question and its solution, please provide an example of the inputs and expected outputs.
x = randi(100,12,1);
y = randi(50, 12,1);
z = randi(15, 12,1);
M = [x,y,z];
Kategorien
Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!