How to use "Variable Names" from "Import Data" UI in the legend of a plot?
2 次查看(过去 30 天)
显示 更早的评论
Hi
In using the "Import Data" UI, there's a field that's called "Variable Names Row". I tell it the row that labels the columns of my data. In matlab (2016b), I plot the data and then have it put a legend on the plot. I'd like it to use the Variable Names from the Import Data tool. Is there a way to do this? Thanks...
0 个评论
回答(1 个)
dbmn
2017-2-17
Something like this?
a = uiimport('test.csv');
plot(rand(10, 6));
legend(a.colheaders);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!