How do I add a suffix using a portion of the the imported excel file name to the name of output variables?

2 views (last 30 days)
I have the attached code. I am sure it is not ideal as I am both new to programming and Matlab.
How do I add a suffix using a portion of the the imported excel file name to the name of output variables?
I want to change the following variables for this particular spread sheet (see attached):
A_B_1 to A_B_1h_1H
A_1 to A_1h_1H
B_1 to B_1h_1H
Any suggestions and advise would be most helpful.
Regards.
  1 Comment
Stephen23
Stephen23 on 6 Jan 2019
Edited: Stephen23 on 6 Jan 2019
"How do I add a suffix using a portion of the the imported excel file name to the name of output variables?"
That is unlikely to be good data design, and most likely will make your code more complex than it needs to be (as well as slower, buggier, and harder to debug).
"Any suggestions and advise would be most helpful."
First read this:
and then use indexing. Remember that meta-data is also data, and so it should be stored as data in its own right as the value of a variable, not forced awkwardly into the name of a variable.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!