How to put 8 variables into a single matrix?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
Nupur
il 1 Lug 2023
0 voti
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));
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!