MATLAB: How to insert symbols in a vector in Matlab

symbols

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 ?

Best Answer

  • a=[3 4 6 8 1 5 8 9 3 7 3 6 ]
    str=strsplit(sprintf('#%d %d@ %d$ %d< ',a) )
    str(end)=[]