Convert matrix into the tensor
Mostra commenti meno recenti
Hi, I have some doubts about how can i convert a matrix into the Tensor... My situation: I have a matrix of 250X24, being that first column is associate the plant species while second column represent substances. However, for each substance were performed 22 experiments resulting on values. I want to convert this matrix into the tensor way where I have in the rows, the species, in the columns, substances and to each substance a third dimension corresponding the values of 22 experiments Here is a example of matrix,
1 60 0 1 1 0
2 60 0 1 1 0
3 11 1 1 1 0
3 17 1 1 1 0
3 18 1 1 1 0
3 20 1 1 1 0
3 22 1 1 1 0
3 28 1 1 1 0
3 33 1 1 1 0
3 37 1 1 1 0
3 48 1 1 1 0
3 49 1 1 1 0
3 52 1 1 1 0
3 55 1 1 1 0
4 11 3 1 1 0
4 17 3 1 1 0
first column are species, second, number of the substance, i.e., I want to organize this first row in the this manner: 1 row, sixth column and third dimension the rest (0 ,1 ,1, 0 son on)... Sorry If I don't get explain correctly Thanks
1 Commento
Andrew Newell
il 29 Gen 2012
The number of elements (250x24) is not divisible by 22, so apparently not all 22 experiments were performed on each substance.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Import Data 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!