I have this array [0:0.1:10]; I want to write these numbers in a file with four columns for example: 0 0.1 0.2 0.3; 0.4 0.5 0.6 0.7; 0.8 0.9 1 1.1; ... Thanks

답변 (1개)

Guillaume
Guillaume 2017년 10월 17일

0 개 추천

csvwrite('C:\somewhere\somefilename.txt', reshape(yourarray, 4, []).');
would be one way. Assuming that the number of elements in the array is a multiple of 4 of course.

댓글 수: 2

Engineer
Engineer 2017년 10월 17일
Thanks Guillaume, In general the length of array is not multiple of 4....
Engineer
Engineer 2017년 10월 17일
In addition as a delimiter I want just a space between number not commas... Thank you

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

질문:

2017년 10월 17일

댓글:

2017년 10월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by