A way to incorporate the name of one vairable into another?

1 view (last 30 days)
I have 5 arrays, A1, A2, A3, B, and C. I have an algorithm that finds matches between values in the A arrays and the B and C arrays then collects them in a matrix "match_results". Is there a way to incorporate the name of the A array into the match_results name? That is have the code output "match_results_A1", etc, after running?
Another way of asking: Say I have arrays A, B C, D and E. I want my code to compare A to D and E, then output a match_results matrix, then compare B to D and E and output a second match matrix, then the same for C. Ideally, I would end up with three matrices labeled "match_A" "match_B" and "match_C". Is there a way to do this, or am I just going to get multiple instances of "DON'T DO THIS! http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F"?

Answers (1)

Image Analyst
Image Analyst on 3 Jun 2014
To me, that seems like a very bad idea , something along the lines of http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F
  7 Comments
Ben
Ben on 4 Jun 2014
Ok. I'll look into alternatives. Thanks for your responses.

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!