Questions tagged [textscan]

Matlab function for reading formatted data.

textscan is a Matlab function for reading formatted data from text file or string.

For more details, see the Matlab's official doc.

222 questions
0
votes
1 answer

import specific columns and range of rows from .dat file

How would I import the data from the fourth row from the following .dat file: #0 Date-time: 07/06/2011 09:13:53 #1 Recorder: 10T2607 #2 File type: 1 #3 Columns: 3 #4 Channels: 1 #5 Field separation: 0 #6 Decimal point: 0 #7 Date…
KatyB
  • 3,920
  • 7
  • 42
  • 72
0
votes
1 answer

optimize this code?

I have a "parent" text file called reference, which is: VERSION 3.82 CALCULATION 3 OPTIONS 0 PROJNAME DATE ENGINEER NOTES "" PASSWORD MSTART CONSTANTS RHO 1.225 RHOW 1027 VISCOS .0000182 GRAVITY 9.81 MEND MSTART WINDND SPMODEL 7 NLAT 31 NVER…
fpe
  • 2,700
  • 2
  • 23
  • 47
0
votes
3 answers

Use textscan to read datablock

How to extract the "mean" and "depth" data like the following of each month? MEAN, S.D., NO. OF OBSERVATIONS January February ... Depth Mean S.D. #Obs Mean S.D. #Obs …
-1
votes
2 answers

Extract or import two Specific values form Text file - MATLAB

I am working on a problem in MATLAB, in which I need to import two specific values (highlighted) from a text file as shown in the figure 1. Corresponding .txt file is attached in the following link (Link)
The_Learner
  • 589
  • 1
  • 6
  • 16
-1
votes
1 answer

Read a .rad file using matlab (textscan without first lines)

I'd like to read into matlab my .rad file which is like that : https://www.dropbox.com/s/w057nsnvquzrc18/RAD.rad?dl=0 I tried to use textscan and this : D = textscan(fid, '%f %f %f %f %f','Delimiter',' ','headerlines', 19); I got this : Thanks…
YLM
  • 335
  • 6
  • 17
-1
votes
1 answer

Matlab: How to read data file containing sequential (x,y) numerical tables with text titles, and plot the data?

I have x-y data that exists in a text file, which looks like this: (("height-0.3m") -0.0527942 0.0595315 -0.0525685 0.0594241 ) (("height-0.55m") -0.0527939 0.0263362 -0.0525683 0.0265083 ) (("height-0.83m") -0.0528517 …
Emma
  • 149
  • 10
-1
votes
1 answer

Matlab, textscan error

I get an error when I run a Matlab code (attached), that continuosly check and opens two .txt files at a given time interval, (2 seconds) and depending on the result a value comparison between those two files, chose one or another and use it....…
Geonik
  • 65
  • 7
-1
votes
2 answers

Matlab: reading text file information with blanks

I have a horrible text file full of blanks (Example below), I need the information in the 6th column (e.i. 9381950, 9332480, and 9997980) but the sporadic blanks are making textread or textscan commands problematic even with detailed formatting. Is…
FireSky
  • 181
  • 4
  • 17
-2
votes
1 answer

Read certain paragraph from text files matlab

I am using matlab to extract words from text files. I have several text files and I want to textscan 'AB' part of each file. From my knowledge I know how to read specific lines from a text file, however, because I want apply the same code for all…
tamkrit
  • 27
  • 5
-2
votes
1 answer

how to read a multiple folders then read single text file and remove header and footer

I have 30 folders in 'E:\meta data\new\data _thesis\NCEP\potential_temperature' directory. These folders are name from 1985 to 2015. In each folder there is 12 folders name apr,aug,dec,feb,jan,july,jun,marc,may,nov,oct,sept. And in each sub folder…
-2
votes
1 answer

How could I get the selected data in the specific rows and columns from data files in MATLAB?

I need your help. I have one data file like below, frames.trr frame 0:00 natoms= 1000 step= 0 time=0.0000000e+00 lambda= 0 box (3x3): box[ 0]={ 1.72E+01 0.00E+00 0.00000e+00} …
S.Baek
  • 1
  • 1
-4
votes
2 answers

How can I search a text file for Count specific words using matlab?

I need to write a program in matlab that searches for specific key words in a text file and then Count the number of this specific word in text.
eman
  • 33
  • 1
  • 5
1 2 3
14
15