New to matlab. Trying to make a script to reorganize excel data
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello. I have an excel file that contains two columns, column one contains numbers and column two contains strings. I am trying to write some code that allows me to collect the number in the row that I given string is present. For example, for the string 'dog' I want to the program to look for every iteration of 'dog' and grab the number that is in the same row and place it in a column of a new excel file under the column header dog.
Any help is appreciated!
Réponses (1)
David Hill
le 6 Mai 2021
a=readcell('yourcellname');
b=unique(a(:,2));
newCell=b';
for k=1:length(b)
newCell(2,k)={a(ismember(a(:,2),b{k}),1)};
end
0 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!