Creating new variable using different row and column chunks from a matrix
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
My data (D) is a '29x46 double' matrix.
I want to sort and create six columns variable(Training1_T) usign the different chunks of a data.
For explaination:
I'm using the following code which is error-free but is not generating the output file I desire
Training1_T= D ([1:14,17:21],[15:29,32:36]);
where from the D matrix, I want matlab to pick two chunks of the data. In the first chunk, I want matlab to use the 1-14th rows and the 17-21st column. For the second chunk, i want the 15-29th rows and 32-36th columns. Finally, I want the output file to have 5 columns only where the second chunk starts from the next row in the new output variable (Training1_T).
The current output is a 19x20 double file but I want it to give me 29x5 output
Please Help. Thank you in advance
0 Commenti
Risposte (1)
Fangjun Jiang
il 25 Set 2023
Modificato: Fangjun Jiang
il 25 Set 2023
D=rand(29,46);
Training1_T= [D(1:14,17:21);D(15:29,32:36)]
0 Commenti
Vedere anche
Categorie
Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!