MATLAB: How to write non numeric matrix into a xls file

matrix xlswrite non numeric

My commands are:-
>>a = sym('ar')
>>d = sym('dr')
>>TPMN3m2 = [1-a a 0 0 0 0 0 0 0 0 0; 0 1-a a 0 0 0 0 0 0 0 0; 0 0 1-a-d a d 0 0 0 0 0 0; 0 0 0 1-d 0 d 0 0 0 0 0; 0 0 0 0 1-a-d a 0 d 0 0 0; 0 0 0 0 0 1-a-d a 0 d 0 0; 0 0 0 0 0 0 1-d 0 0 d 0; 0 0 0 0 0 0 0 1-a a 0 0; 0 d 0 0 0 0 0 0 1-a-d a 0; 0 0 d 0 0 0 0 0 0 1-a-d a; 0 0 0 d 0 0 0 0 0 0 1-d]; % DEfining TPM for N=3 and m=2
>> TPMN3m2P3 = TPMN3m2*TPMN3m2*TPMN3m2
I want to write the data in TPMN3m2P3 to a xls file. How do I do it?

Best Answer

xlswrite( 'YourFile.xls', arrayfun( @char , TPMN3m2P3, 'Uniform', 0) )
You might also be able to use just
But you might want to experiment with char(TPMN3m2P3) and see what you get (I don't know)