How to put 8 variables into a single matrix?
Ältere Kommentare anzeigen
I have 8 variables each of them having dimension(65,1). I want to put them in a matrix of dimension(65,8). Please suggest me how to do it using matlab code.
Devendra
Akzeptierte Antwort
Weitere Antworten (1)
Nupur
am 1 Jul. 2023
0 Stimmen
Try the following please:
% Assuming you have eight variables: var1, var2, var3, var4, var5, var6, var7, var8
% Combine the variables into a matrix
combinedMatrix = [var1, var2, var3, var4, var5, var6, var7, var8];
% Alternatively, you can use the horzcat function
% combinedMatrix = horzcat(var1, var2, var3, var4, var5, var6, var7, var8);
% Display the size of the combined matrix
disp(size(combinedMatrix));
Kategorien
Mehr zu Creating and Concatenating Matrices 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!