How to insert symbols in a vector in Matlab
3 次查看(过去 30 天)
显示 更早的评论
I have a vector of 12 entities in Matlab. a=[3 4 6 8 1 5 8 9 3 7 3 6 ] I want to insert symbols at regular intervals along with the values. The final value of a looks like this. a=[#3 4@ 6& 8< #1 5@ 8& 9< #3 7@ 3& 6<] As can be seen that the symbols are being repeated after 3 entities. How can this be achieved in Matlab ?
1 个评论
Adam
2016-8-9
You can do that as a string, but not in a numeric vector because obviously those elements are not numeric. If you have a vector of chars then it is trivial depending at what point you have the various information to create the end result.
采纳的回答
Azzi Abdelmalek
2016-8-9
编辑:Azzi Abdelmalek
2016-8-9
a=[3 4 6 8 1 5 8 9 3 7 3 6 ]
str=strsplit(sprintf('#%d %d@ %d$ %d< ',a) )
str(end)=[]
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!