MATLAB: Way to output a matrix or dat file

MATLABmatrix

I am new to matlab, and trying to figure out a way to ouput. I would like to output into a data file or matrix variable. I have it calculating in a for loop because it goes through a matrix of symbols I have.
symbol1 symbol2 egcitestpvalue
It doesn't appear to like when I try to mix and match numerical data with text. What is the best way to have it output versus having it go to the command window. I would like some sort of grid I can export, sort in excel, etc.

Best Answer

I am not sure if csvwrite will work with strings. You may need to use xlswrite instead, or you could try to create your own customized function using fprintf. For example:
function myFileExport(filename,A)
csv = fopen(filename,'w');
fprintf(csv, ... );
fprintf(csv, ... );
...
fclose(csv);
end
HTH.
Rick