how to concatnate cells within a column
    7 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
i have a column of cells that i would like to group/concatnate into one row for example:
Carboplatin & pemetrexed maintenance pemetrexed docetaxel
should become this: Carboplatin & pemetrexed||maintenance pemetrexed||Docetaxel
how do i do this without having to manually input the following code:
 a=strcat (data2.REGIMEN{1},'||',data2.REGIMEN{2},'||',data2.REGIMEN{3});
2 comentarios
Respuestas (2)
  F.
      
 el 14 de Ag. de 2013
        I think you should try this:
 % code
strcat( sprintf( '%s||', Data2 .REGIMEN{1:end-1} ) , Data2.REGIMEN{end} )
OR
 % code
Tmp = strcat(  Data2 .REGIMEN(1:end-1), '||' );
strcat( [ Tmp{:} ] , Data2.REGIMEN{end} )
0 comentarios
Ver también
Categorías
				Más información sobre Logical en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



