I have something like the following:
A = [1 2 5; 1 5 7];
B = A(1,:);
I output B:
B = A(1,:);
B =
1 2 5
I am looking to combine what is contained in B into one single string:
1/2/5
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
sprintf:This will give you almost what you want, it will have unnecessary
/in the end.If you want to remove it:
As @hmuster points out correctly, it is possible to do it with
\b, the backspace character.However, as @AndrewJanke points out correctly, it could become a problem if this string is written into a pipe or a file. So use it with caution.