how to do zero padding in middle

조회 수: 2 (최근 30일)
Lalit Patil
Lalit Patil 2012년 11월 21일
I have some text files.. All text file contains two columns. both of 480 rows. But some text files have some rows missing.. In one of them after 63rd row directly there is 86th row.. So, total rows get reduced to 450. Now i want to convert this rows in again 480rows by zero padding from 64th to 85th.. So, how to do..? This text file is attached here.. http://www.fileconvoy.com/dfl.php?id=g4a8afb397a4e11ed999171111e1b74b570928a6b1
  댓글 수: 3
Lalit Patil
Lalit Patil 2012년 11월 21일
Ok..Is there any other way to upload my text file here..! or if you know any other site..

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

답변 (1개)

Walter Roberson
Walter Roberson 2012년 11월 21일
Consider using textscan() with the MissingValue option set to 0
  댓글 수: 5
Walter Roberson
Walter Roberson 2012년 11월 21일
If the values can go at the end then if M is what you read the data in to,
M(end+1:end+length(missingvalues), 1) = missingvalues;
and then write the file out in an appropriate format.
Lalit Patil
Lalit Patil 2012년 11월 21일
I got solution.. First i find missing values then stored it in another text file, then merged both files.. so, i got total 480 rows... Thanks for help..!

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

카테고리

Help CenterFile Exchange에서 Standard File Formats에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by