Doxygen Source Code Documentation
wryte3.m File Reference
Go to the source code of this file.
Functions | |
| n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with | vectors (Nx1) |
| n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with They are written very efficiently | verbose (0/1) |
| Set the defaults | if (nargin< 3) |
| end | if (~isfield(Opt,'Space')|isempty(Opt.Space)) |
| end | if (~isfield(Opt,'OverWrite')|isempty(Opt.OverWrite)) |
| end | if (~isfield(Opt,'Fast')|isempty(Opt.Fast)) |
| end | if (~isfield(Opt,'verbose')|isempty(Opt.verbose)) |
| end Check for bad input | if (isempty(M)) |
| end | if (eq_str(Opt.Fast,'y')&eq_str(Opt.Space,',')) |
| end | ErrEval (FuncName,'Wrn_Can not run in fast mode with comma separators, will use slow mow.') |
| if (filexist(Fname)) | |
| return case all cool proceed case | while (filexist(Fname)==1) |
| ErrEval (FuncName, serr) | |
| if (fid==-1) | |
| return end Write the data switch Opt case fast mode | if (eq_str(op,'a')) |
| end | if (Opt.verbose) |
| end | fprintf (1,'%s verbose:Writing%s in Fast Mode...', FuncName, Fname) |
| end | if (eq_str(Opt.Space,'t')) |
| end | eval (['save 'Fname 'M-ascii-tabs-append']) |
| elseif (eq_str(Opt.Space,'s')) | |
| if (jj==1) | |
| I can go fast on this one | fprintf (1,'%s verbose:Writing%s in Efficient Mode...', FuncName, Fname) |
| end | if (eq_str(Opt.Space,'s')) |
| end | fprintf (fid,'%g\n', M(1:ii-1)) |
| end | fprintf (fid,'%g\t\n', M(1:ii-1)) |
| end | if (eq_str(Opt.Space,',')) |
| end | fprintf (fid,'%g,\n', M(1:ii-1)) |
| end Now put the last value in | fprintf (fid,'%g\n', M(ii)) |
| end | if (jj > 1) |
| end | fprintf (1,'%s verbose:Writing%s in Slow Mode...', FuncName, Fname) |
| for (i=1:1:ii) | |
| if (i==ii) | |
| end | for (j=1:1:jjtemp) |
| end | fprintf (fid,'%g ', M(i, j)) |
| end | fprintf (fid,'%g\t', M(i, j)) |
| end | fprintf (fid,'%g,', M(i, j)) |
| end end | if (i~=ii) |
| end end | fprintf (fid,'\n') |
| end end Now put the last number in | fprintf (fid,'%g\n', M(ii, jj)) |
| return end | fclose (fid) |
| fprintf (1,'Done.\n') | |
Variables | |
| function [err, Fname] | |
| n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to | y |
| n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is | fast |
| n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with They are written very efficiently default is Output | Parameters |
| n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with They are written very efficiently default is Output unless you re prompted to change it More | Info |
| initailize return variables | err = 1 |
| UsedName = '' | |
| Set the defaults | Opt = [] |
| end Opt | Space = 's' |
| end Opt | OverWrite = 'n' |
| end Opt | Fast = 'n' |
| end Opt | verbose = 0 |
| return | |
| end Do the deed Check for filename existence | op = 'w' |
| switch Opt case | n |
| return case all cool proceed case | p |
| return case all cool proceed case | serr = sprintf ('Wrn_File %s exists, enter new filename:',Fname) |
| Fname = input ('','s') | |
| end | |
| case | a |
| otherwise | |
| return end end Open file for write operation | fid = fopen(Fname,op) |
| return end Write the data switch Opt case fast mode | apnd = '-append' |
| end case slow | mode [ii, jj] = size(M) |
| end | jjtemp = jj |
Function Documentation
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
Referenced by ENV_init(), and main(). |
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Variable Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial value: wryte3 (M,Fname,Opt) % % [err,UsedName] = wryte3 (M,Fname,[Opt]) % %Purpose: % Write matrix M to a text file % % %Input Parameters: % M : NxK matrix % Fname : string containing the file name to write the matrix to % Opt is an optional structure with the following fields % .Space string specifying whether to use a space character 's' or % a tab 't' or a comma ',' between numbers on the same line. % The default is 's'. There won't be a comma after the last number. % .OverWrite specifies whether you want to allow for overwrite % Options are 'y' for yes |
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 93 of file wryte3.m. Referenced by cktype(), do_fio(), exar2(), intrcall(), krput(), NC_var_shape(), out_call(), putmnmx(), SUMA_AddDO(), SUMA_AdvancePastNumbers(), SUMA_OpenDx_Object_Attr(), SUMA_OpenDx_Object_Components(), SUMA_OpenDx_Object_Data(), SUMA_OpenDx_Object_Header_Field(), SUMA_OpenDX_Read(), and SUMA_RemoveDO(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 47 of file wryte3.m. Referenced by SUMA_Addto_ROIplane_List(). |
|
|
|
|
|
|