how to add zero padding to text file to make 250x4
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to add zeros to make my data eqaully balance with 250 rows and 4 columns. can anyone help?
답변 (1개)
Sulaymon Eshkabilov
2021년 7월 14일
편집: Sulaymon Eshkabilov
2021년 7월 14일
X = load("Test0.txt"); % Original data file
x1 = zeros(250,4); % Zeros 250-by-4
XX = [x1;X]; % All data augmented
writematrix(XX,'Test_New.txt','Delimiter','tab') % Written a new data file in *.txt
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!