New to matlab. Trying to make a script to reorganize excel data
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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!
Respuestas (1)
David Hill
el 6 de Mayo de 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 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!