MATLAB: Pls help GUIDE display complex

guide display complex static text

i want to display on static text my ouput format from solve()
sample
f=solve(e)
e= 1+2i
3+1i
6+2i
but i cant get the right code to display it
this is the code that im using
f=solve(e)
output2=set(handles.output2,'string' ,char(f));
i can get my desired output on command window but on my GUIDE im having a matrix output like this
matrix([[2+1i]])
pls help tnx alot

Best Answer

f = sym([2+1i; 3+1i;6+2i])
f_cell = arrayfun(@char, f, 'uniform', 0);
f_char = char(f_cell);
Use f_char if you want to set() the control to a char matrix. Use f_cell if you want to set the control to a cell array of strings. I would usually recommend a cell array of strings for this purpose.