Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


cstring.m

Go to the documentation of this file.
00001 function str = cstring(x)
00002 %
00003 %CSTRING Print to a string like c
00004 %  CSTRING(x) takes an array x, of type char, and prints it to
00005 %  a string the way C would.
00006 %  the first null, or non-ascii character is the terminator
00007 
00008 i=1;
00009 while (x(i)>0 & x(i)<128 & i<length(x))
00010   i=i+1;
00011 end
00012 
00013 if i==1
00014   str = char(0);
00015 else 
00016   str = char(x(1:i-1));
00017 end
00018 
00019 str = sprintf(str,'%s');
00020 
00021 return
 

Powered by Plone

This site conforms to the following standards: