From: Jose on
I want to know how I can save the data of the following output function into a an external text file.

But I am getting this problem,
??? Error using ==> fwrite
Cannot write value: unsupported class sfit
Error in ==> Read_Multiple_Photos at 148
fwrite(fid,createSurfaceFit(rows,columns,intensity_1), '\n');

My algorithm,

text_file = ['Data_out1' '.txt'];
fid = fopen(text_file,'w');
fprintf(fid,' A Ib Sigma x_o y_o Photo_File \n' );
fwrite(fid,createSurfaceFit(rows,columns,intensity_1), '\n');

The function output is:

General model:
ans(x,y) = A*exp(-(((x-x_o)^2+(y-y_o)^2)/(2*sigma^2)))+Ib
Coefficients (with 95% confidence bounds):
A = 7751 (7584, 7919)
Ib = 579.8 (552.6, 607.1)
sigma = 1.739 (1.71, 1.768)
x_o = 7.211 (7.173, 7.248)
y_o = 10.12 (10.08, 10.15)
From: us on
"Jose " <darkz0n3(a)hotmail.com> wrote in message <i06das$glg$1(a)fred.mathworks.com>...
> I want to know how I can save the data of the following output function into a an external text file.
>
> But I am getting this problem,
> ??? Error using ==> fwrite
> Cannot write value: unsupported class sfit
> Error in ==> Read_Multiple_Photos at 148
> fwrite(fid,createSurfaceFit(rows,columns,intensity_1), '\n');
>
> My algorithm,
>
> text_file = ['Data_out1' '.txt'];
> fid = fopen(text_file,'w');
> fprintf(fid,' A Ib Sigma x_o y_o Photo_File \n' );
> fwrite(fid,createSurfaceFit(rows,columns,intensity_1), '\n');
>
> The function output is:
>
> General model:
> ans(x,y) = A*exp(-(((x-x_o)^2+(y-y_o)^2)/(2*sigma^2)))+Ib
> Coefficients (with 95% confidence bounds):
> A = 7751 (7584, 7919)
> Ib = 579.8 (552.6, 607.1)
> sigma = 1.739 (1.71, 1.768)
> x_o = 7.211 (7.173, 7.248)
> y_o = 10.12 (10.08, 10.15)

well... obviously you first must extract the data you want to save from the object, which seems to be returned by CREATESURFACEFIT...
see its help...
or

methods createSurfaceFit;

us
From: ImageAnalyst on
Yes, plus the fact that '\n' is not allowable as the
"machineprecision" third argument. It needs to be something like
'int32' or 'double'. Maybe you thought you were using fprintf() (like
you did in the first statement) instead of fwrite().
From: Jose on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <39eaf608-bf6f-4258-80f1-a4113032e847(a)x21g2000yqa.googlegroups.com>...
> Yes, plus the fact that '\n' is not allowable as the
> "machineprecision" third argument. It needs to be something like
> 'int32' or 'double'. Maybe you thought you were using fprintf() (like
> you did in the first statement) instead of fwrite().

But I cant get or see in any way the results because the format in the workspace is
1x1 sfit. Any idea of how to get it?
From: us on
"Jose " <darkz0n3(a)hotmail.com> wrote in message <i085d9$hv6$1(a)fred.mathworks.com>...
> ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <39eaf608-bf6f-4258-80f1-a4113032e847(a)x21g2000yqa.googlegroups.com>...
> > Yes, plus the fact that '\n' is not allowable as the
> > "machineprecision" third argument. It needs to be something like
> > 'int32' or 'double'. Maybe you thought you were using fprintf() (like
> > you did in the first statement) instead of fwrite().
>
> But I cant get or see in any way the results because the format in the workspace is
> 1x1 sfit. Any idea of how to get it?

did you look at what i told you earlier(?)...

us