Data and fprintf

1 visualización (últimos 30 días)
Zach
Zach el 30 de Sept. de 2011
I have the following 2 lines
Data={'The calculated means for ERP0 are ','The standard deviations for ERP0 are ', 'The calculated means for ERP08 ', 'The standard deviations for ERP08 are ', mean0 stdev0 mean08 std08};
fprintf('\n %s %d \n', Data{:})
Where mean0 stdev0 mean08 std08 are 1 by 5 arrays What i want is: The calculated means for ERP0 are... then the numbers in mean0
for each variable and sentence corresponding
What i am currently getting are the words and then the values all displayed underneath like 'The calculated means for ERP0 are ', 'The standard deviations for ERP0 are ', 'The calculated means for ERP08 ', 'The standard deviations for ERP08 are '
then the numbers for mean0 stdev0 mean08 std08

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 30 de Sept. de 2011
Make Data like this:
Data={'The calculated means for ERP0 are ','The standard deviations for ERP0 are ', 'The calculated means for ERP08 ', 'The standard deviations for ERP08 are '; mean0 stdev0 mean08 std08}
Notice the ";" instead of ",". The point is to make Data a 2x4 cell array rather than 1x8 array, then the fprintf() code you have should get what you want.

Más respuestas (0)

Categorías

Más información sobre Bioinformatics Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by