MATLAB Answers

importing .las data as table for analysis.

23 views (last 30 days)
Dear all, I am using Matlab to analyse some data. The data are in .las format versions from 1 to 3. I can't use readtable as it gives me unknown file format error "Error using readtable (line 198) The file extension '.las' is not recognized." Any idea how to import these files into tables? Thanks


Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 21 Nov 2017


Show 4 older comments
Moustafa Elzeftawy
Moustafa Elzeftawy on 5 Dec 2017
Thanks for your help Walter! It's working now.
I would appreciate if you could help me to extract the curves into a table and use the curves' names as column name.
Regards Moustafa
Walter Roberson
Walter Roberson on 5 Dec 2017
array2table(wlog.curves, 'VariableNames', wlog.curve_info(1,:))
Moustafa Elzeftawy
Moustafa Elzeftawy on 5 Dec 2017
Tried the command and got the following error
>> las=array2table(wlog.curves, 'VariableNames', wlog.curve_info(1,:));
Error using matlab.internal.tabular.private.varNamesDim.makeValidName (line 433)
'DEPTH Reversed.' is not a valid variable name.
Error in matlab.internal.tabular.private.varNamesDim/validateAndAssignLabels (line 311)
[newLabels,wasMadeValid] = obj.makeValidName(newLabels,exceptionMode);
Error in matlab.internal.tabular.private.tabularDimension/setLabels (line 173)
obj = obj.validateAndAssignLabels(newLabels,indices,fullAssignment,fixDups,fixEmpties,fixIllegal);
Error in matlab.internal.tabular.private.tabularDimension/createLike_impl (line 355)
obj = obj.setLabels(dimLabels,[]);
Error in matlab.internal.tabular.private.varNamesDim/createLike (line 70)
obj = obj.createLike_impl(dimLength,dimLabels);
Error in tabular/initInternals (line 207)
t.varDim = t.varDim.createLike(nvars,varnames); % error if invalid, duplicate, or empty
Error in table.init (line 327)
t = initInternals(t, vars, numRows, rowLabels, numVars, varnames);
Error in array2table (line 64)
t = table.init(vars,nrows,rownames,nvars,varnames);
Then I created a new variable that has the names in a row as following
>> wlog.curve_name=(wlog.curve_info(:,1))'
wlog =
struct with fields:
type: 'well_log'
tag: 'unspecified'
name: 'las3'
first: 221.1000
last: 523
step: 0.1000
units: 'm'
null: NaN
from: 'las3.las'
curve_info: {17×3 cell}
curves: [3020×17 double]
wellname: 'MIH_EMERALD_1'
field: 'ATP 447P'
location: 'EMERALD'
province: 'QUEENSLAND'
service: 'BPB Wireline Services'
date: '5-JUL-1992'
wellid: 'MIM E01 TD'
curve_name: {1×17 cell}
and tried the modified code
las=array2table(wlog.curves, 'VariableNames',wlog.curve_name);
and the table was created successfully.
Thanks for your help

Sign in to comment.

More Answers (0)

Sign in to answer this question.