Converting sym to string without 'matrix....' before
显示 更早的评论
Hi,
I need some help to convert a symbolic array to string.
I tried with:
syms a b c
Array = [a b c];
string = char(Array);
but it returns
matrix([[a b c]]);
Is there a way to take only the string inside ? I need set it to take '[a b c]' as string.
Thanks
采纳的回答
更多回答(1 个)
Walter Roberson
2017-11-7
In the case of symbolic row vectors:
['[', strjoin(arrayfun(@char, Array, 'uniform', 0),', '), ']']
类别
在 帮助中心 和 File Exchange 中查找有关 Operations on Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!