how to add zero padding to text file to make 250x4
4 次查看(过去 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!