I need help with finding correct variables

2 views (last 30 days)
I am new to MATLAB- I need help identifying the correct variables for the following commands:
Tension of string
Linear mass density
Speed of sound in air
Speed of sound in bar
Radii of tube
Thickness of rectangular bar
For example when defining the formula for tension, do I use T=, or is there a standard variable that needs to be used for all of these?
Thank you!

Accepted Answer

Image Analyst
Image Analyst on 3 Jun 2015
You can use any variable names you want, but I encourage you to use descriptive names like airSpeed, and stringTension. (They need to have only numbers and letters in them but can't start with a number. Some special characters are allowed, like underlines, but most aren't.) Otherwise if you have a large program and just use one of two letter variables, it can look like a confusing mess - a virtual alphabet soup of letters that no one can follow. Also, make sure you use a lot of comments explaining what you're doing, especially if anyone other than you will look at your code ever.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!