Populate single column of data of engineering format into a 4-D array

Hi guys, I have a single column of data containing exponents: 1.245e-46 3.922e-9 -6.478e-9 8.145e-9 -9.260e-9 10.04e-9 I have 11x73x73x22=1289618 total lines of the above sort of data in a single column file. What i wish to do is to store that data in a (11x73)x73x22 (row*column*page*book) 4-D array. so essentially form it as consecutive (11x73) arrays formed into consecutive 73 pages into consecutive 22 books.

 채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 8일

0 개 추천

reshape(x, [11,73,73,22])

댓글 수: 2

Lance Ayo
Lance Ayo 2015년 9월 8일
편집: Lance Ayo 2015년 9월 8일
Hi Walter, Thanks for your response. Is x the array i read in from using tesxtscan? If so, how do i make sure textscan does not approximate the numbers to zero. For example textscan approximates my data to all zeros when i read in with the following: my_data=textscan(fidi,'%d64 %*[^\n]'); my values include negative numbers also. e.g 2e-9, -3e-10 Thanks!!!
Actually a simple x=load('file') followed by the reshape works fine!!!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

질문:

2015년 9월 8일

댓글:

2015년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by