From: Steven Lord on 27 Jun 2010 21:24 "Jose " <darkz0n3(a)hotmail.com> wrote in message news: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'); FWRITE doesn't know how to write the object returned by createSurfaceFit to a file. You need to extract the information from the object using its methods and properties (call METHODS and PROPERTIES on the object) and then write that data out using an appropriate format. Alternately, would saving the object to a MAT-file be sufficient for your needs? That way, you can LOAD it in a later session and use the stored object. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Jose on 27 Jun 2010 23:06 "Steven Lord" <slord(a)mathworks.com> wrote in message <i08tk8$r0g$1(a)fred.mathworks.com>... > > FWRITE doesn't know how to write the object returned by createSurfaceFit to > a file. You need to extract the information from the object using its > methods and properties (call METHODS and PROPERTIES on the object) and then > write that data out using an appropriate format. > > Alternately, would saving the object to a MAT-file be sufficient for your > needs? That way, you can LOAD it in a later session and use the stored > object. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com > Thanks you guys, it worked!
From: us on 28 Jun 2010 02:29
"Steven Lord" <slord(a)mathworks.com> wrote in message <i08tk8$r0g$1(a)fred.mathworks.com>... > > "Jose " <darkz0n3(a)hotmail.com> wrote in message > news: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'); > > FWRITE doesn't know how to write the object returned by createSurfaceFit to > a file. You need to extract the information from the object using its > methods and properties (call METHODS and PROPERTIES on the object) and then > write that data out using an appropriate format. > > Alternately, would saving the object to a MAT-file be sufficient for your > needs? That way, you can LOAD it in a later session and use the stored > object. if you use this method, you must make sure the program resides in the folder you're working, ie, SAVEing/LOADing, or in ML's path... otherwise, you will get errors if you LOAD your MAT-file... us |