help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: : new to octave, confused about load(), dlmread et cetera


From: justin.cress
Subject: Re: : new to octave, confused about load(), dlmread et cetera
Date: Wed, 1 Sep 2010 13:27:33 -0700 (PDT)

k, after some thought, I decided to

outsheet YVAR using yvar.txt, replace comma
outsheet SOME X VARS using xvar.txt, replace comma

from stata, and i wrote the following function (based on the OP's code,
credit and thanks) to grab variables. 


function var = indata(file,dlm)
## 
# Function for grabbing variable names and data, to be returned in a
structure
# usage is just indata(filename, delimiter)
## 

fid=fopen(file,"r");
row1=fgetl(fid);
var.name = strsplit(row1,dlm); 
var.data = dlmread(file,dlm);
var.data(1,:)=[];
fclose(fid);
endfunction

yvar = indata("yvar.txt",",");
xvar = indata("xvar.txt",",");
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/new-to-octave-confused-about-load-dlmread-et-cetera-tp2402617p2416849.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]