This function produces a transpose of any table
smsinks (2021). transposeTable (https://www.mathworks.com/matlabcentral/fileexchange/65743-transposetable), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Thanks, Julian. I didn't know about rows2vars in R2018b.
I saw MathWorks added rows2vars in R2018b, which does much the same as your function - and suggests you discovered a previously unmet need! I am not rating your submission because I haven't used it myself (I will likely use rows2vars for this purpose).
For interest you might know that the function matlab.lang.makeValidName is probably easier to generate variable names than using regex.