How to change values in legend based on calculated variables?

I have variables v1,v2,v3,v4,v5. And these values depended on input. Every time I change the input I, These values gets altered.
Now, I need to add those values in legend. i.e., I have to attach values of variables directly in legends command.
I need suggestion for this. How to code for this particular case?

You can use legend({'entry1';'entry2';...}) for this if you convert your values to strings first and then convert the string array to a cell array. Try this example:

v1 = rand; v2 = rand; v3 = rand; v4 = rand; v5 = rand;
x = (1:5).';
y = x.*[v1 v2 v3 v4 v5];
plot(x,y)
legend(cellstr(num2str([v1; v2; v3; v4; v5])))

It will look somewhat nicer with a little formatting for the strings:

legend(cellstr(horzcat(['v1 = ';'v2 = ';'v3 = ';'v4 = ';'v5 = '],num2str([v1; v2; v3; v4; v5],'%.2f'))))

Thanks @MSpo .