Stuart’s MATLAB Videos

Watch and Learn

Some Uses of the MATLAB Function inputname

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.

|
  • print
  • send email

댓글

댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.