Info

この質問は閉じられています。 編集または回答するには再度開いてください。

reading a text file data

2 ビュー (過去 30 日間)
KRISHNA NISHCAL BHARATULA
KRISHNA NISHCAL BHARATULA 2019 年 9 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hello all!, I have a text file and I used 'dlmread' command to read the data, and had the following results:
well = [0 1 2 3 4 0 0;0 5 6 0 0 8 11;0 11 12 0 0 55 49;0 2 88 44 26 0 0;0 8 96 7 4 0 0;0 22 6 41 20 0 0;0 63 5 0 0 11 4; 0 52 8 0 0 63 32];
the above is just a sample format, actually i have a data containing 6511 rows and in between I am seeing this behaviour. I removed the first column of zeros; for which i used this:
well(:,~any(well,1)) = [];
Now, i want to shift those miss-arranged data in appropriate columns and produce result in following manner for the rows (out of 6511) wherever applicable:
result = [1 2 3 4 ;5 6 8 11;11 12 55 49;2 88 44 26;8 96 7 4;22 6 41 20;63 5 11 4;52 8 63 32];
Thank you!
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 9 月 26 日
I wonder if reading with readtable() might not have done a better job for you ?
KRISHNA NISHCAL BHARATULA
KRISHNA NISHCAL BHARATULA 2019 年 9 月 26 日
Thank you Walter! You gave me a wonderful hint and for my next problem as well.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by