From: joseph Frank on
I have an old file that I have received 7 years ago that has an extension "g". I didn't need it then but now i need the info and I am enable to open it. Also, the one who sent it is unreachable. All I know is that the data is in matrix format. IS there a way to open this file with Matlab?
From: ImageAnalyst on
On Aug 7, 2:58 pm, "joseph Frank" <josephfrank1...(a)hotmail.com> wrote:
> I have an old file that I have received 7 years ago that has an extension "g". I didn't need it then but now i need the info and I am enable to open it. Also, the one who sent it is unreachable. All I know is that the data is in matrix format. IS there a way to open  this file with Matlab?

------------------------------------------------
Yes. Use fopen(), fread(), & fclose(). Then make some guess as to
how your data was stored and see what happens. You might have to do
trial and error on data type (single or double), number of rows and
columns, etc. until you get something that makes sense to you.
From: joseph Frank on
Actually i have misjudged the file. it is not data. the files is codes.In order to replicate the codes using matlab I need to know the software to analyze these codes. Does anyone know which software uses this language?

new; __output = 0;
yo = {}; xo = {};
load dat[] = dat/iaa.txt; output file = biaa reset;

dat = reshape(dat,rows(dat)/7,7);
dat = selif(dat,dat[.,3] .ne 0);
dates = unique(dat[.,1],1);

j=1;
do while j <= rows(dates);
b = {0.09525,0.0338,0.015};
ddat = selif(dat,dat[.,1] .== dates[j]);
ddat = sortc(ddat,2);
flag = 0; flag1 = 0;
do while flag == 0;
mat = (ddat[.,2] - ddat[.,1])/365;
ddat = selif(ddat, mat .<=11);
mat = selif(mat, mat .<=11);
ddat = selif(ddat, mat .>=1);
mat = selif(mat, mat .>=1);
if rows(ddat) < 5; flag = 1; endif;
if rows(ddat) >= 5;
flag1 = 1;
pr = ddat[.,4];
dx = gradp(&x,b);
xb = x(b);
u = pr - xb;
tol = (u'dx*inv(dx'dx)*dx'u)/(u'u/rows(ddat));
i = 1;
do while tol > 0.00000001;
dmg = inv(dx'dx)*dx'(pr-xb);
b = b + dmg;
dx = gradp(&x,b);
xb = x(b);
u = pr - xb;
tol = (u'dx*inv(dx'dx)*dx'u)/(u'u/rows(ddat));
i = i + 1;
if i > 1000; tol = 0.00000000001; flag = 1.0; endif;
endo;

mi = maxindc(abs(u));
if abs(u[mi]) >= 5;mc=ones(rows(u),1);mc[mi]=0;ddat=selif(ddat,mc);
else; flag = 1; endif;
endif;
endo;
ddat[1,1]~b';
j = j + 1;
endo;
output off;
screen on;

/* ------------------------------------------------------------------------------------------*/
proc mf(bb,t); retp(exp(-bb[1]*t - (bb[2]+bb[3])*(1-exp(-t)) + bb[3]*t.*exp(-t)));
endp;

proc x(b); @implicitly imported ddat@
local k, x, t, c, a, pp, p;
k = 1; x = {};
do while k <= rows(ddat);
if ddat[k,6].==ddat[k,2]; t = (ddat[k,2]-ddat[k,1])/365;
else;
t = ( (ddat[k,6]-ddat[k,1])/365 ) +seqa(0,.5,floor( (ddat[k,2]-ddat[k,6])/182.5 )+1);
endif;
c = ddat[k,3]/2; a = (ddat[k,1] - ddat[k,5])*c/182.5;
pp = ddat[k,4]; p= -a + c*sumc(mf(b,t)) + 100*mf(b,t[rows(t)]);
x = x | p; k = k + 1;
endo;
retp(x);
endp;

proc par(b); @implicitly imported ddat@
local k, t, c ,cc;
k = 1; c = {};
do while k <= rows(ddat);
if ddat[k,6].==ddat[k,2]; t = (ddat[k,2]-ddat[k,1])/360;
else;
t = ( (ddat[k,6]-ddat[k,1])/360 ) +seqa(0,.5,floor( (ddat[k,2]-ddat[k,6])/180 )+1);
endif;
cc = 100*(1 - mf(b,t[rows(t)]))/sumc(mf(b,t));
c = c | cc; k = k + 1;
endo;
retp(c);
endp;
From: ImageAnalyst on
Looks enough MATLAB-ish to just give it a try. Why don't you just
paste it in to MATLAB and then go down line by line fixing syntax
errors?

endif & endo get replaced with end
retp is probably return
square brackets go to round parentheses
do while goes to while
MATLAB auto-declares so you don't need the "local...." line.
rows(dates); would probably be size(dates), length(dates), or
numel(dates)

and so on....
From: Ross W on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <377e35ef-d7fd-41a5-83e6-e45801cc5977(a)f6g2000yqa.googlegroups.com>...
> Looks enough MATLAB-ish to just give it a try. Why don't you just
> paste it in to MATLAB and then go down line by line fixing syntax
> errors?
>
> endif & endo get replaced with end
> retp is probably return
> square brackets go to round parentheses
> do while goes to while
> MATLAB auto-declares so you don't need the "local...." line.
> rows(dates); would probably be size(dates), length(dates), or
> numel(dates)
>
> and so on....

I think it's GAUSS
http://www.aptech.com/gauss.html
http://www.aptech.com/manuals/LanguageReference5.0.pdf

Ross