Sometimes I need to display the name of a variable as a character array. This can help with the updating of variable names in code and automating the importing or exporting of multiple variables to data sources such as Excel. To do this I use the MATLAB function inputname in a one-line utility varToStr.
Features used in this video include:
- Variable and function highlighting and renaming
- Anonymous functions
- ~ symbol to ignore function arguments
Spot this mistake: I realize that one of the examples of varToStr’s use is in fact incorrect, i.e. it serves no purpose. Can you tell which one?
Play the video in full screen mode for a better viewing experience.
要发表评论，请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。