[fortran90] arrange value in row into column

Click For Summary
SUMMARY

The discussion focuses on converting a one-dimensional array from a row format to a column format using Fortran90 or MATLAB. The user seeks to transform a data file, test.dat, containing a sequence of numbers into a vertical arrangement. It is clarified that in Fortran, a 1D array does not inherently distinguish between row and column vectors, as it is simply a sequence of numbers. Additionally, the nature of data files is explained, emphasizing that they consist of sequences rather than structured rows or columns.

PREREQUISITES
  • Understanding of Fortran90 array handling
  • Familiarity with MATLAB array manipulation
  • Knowledge of data file formats (binary and text)
  • Basic programming concepts in numerical computing
NEXT STEPS
  • Explore Fortran90 array manipulation techniques
  • Learn MATLAB's reshape function for array transformations
  • Investigate file I/O operations in Fortran90 and MATLAB
  • Study data representation in binary versus text files
USEFUL FOR

Programmers, data analysts, and researchers working with numerical data in Fortran90 or MATLAB who need to manipulate array formats for data processing.

s_hy
Messages
57
Reaction score
0
I have a data file, let's say test.dat which is contain [1 2 3 4 5 6 7...3000]. the question is how can I re-arrange this data from a row into a column so that I will have a set of data like this
1
2
3
4
5
6
7
.
.
.
3000

in fortran90 or MATLAB also will be okay.

thank you
 
Technology news on Phys.org
I don't understand what you are trying to do. In Fortran, there is no distinction between a row vector and a column vector. A 1D array is just a 1D array.
 
Also, the data in a file is not arranged in rows or columns. It's a sequence of numbers (binary file) or characters (text file). There can also be non-printing characters such as tab, newline, and other control characters.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K