Error while using dot notation

1 次查看(过去 30 天)
I execute the following code but I get the error "Insufficient number of outputs from right hand side of equal sign to satisfy assignment." I am using MATLAB R2016a.
plot(rand(3))
lgd = legend;
c = lgd.TextColor;
lgd.TextColor = 'red';

采纳的回答

Star Strider
Star Strider 2017-2-18
It works correctly if you provide legend with something to do:
plot(rand(3))
lgd = legend('Data');
c = lgd.TextColor;
lgd.TextColor = 'red';

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by