Data and fprintf
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Fangjun Jiang
2011년 9월 30일
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.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bioinformatics Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!