plot help

2 views (last 30 days)
Edward on 11 May 2012
Hi, im trying to write a simple program to put a legend on the graph using variable names as strings for example i have
how do i get these onto a legend?
I don't want to use legend(var1,var2) as i intend to plot n variables with n different names.

Answers (1)

Walter Roberson
Walter Roberson on 11 May 2012
vars = {'name1', 'name2'};
Dr. Seis
Dr. Seis on 11 May 2012
If "vars" is a cell string... why do you need the {:}, why not just legend(vars) ?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by