How to write a legend in latex format
Show older comments
Npc=2;
legend('\Sigma_{i=1}^{Npc} x^\prime_i','Total L_w','Noise');
In the below figure's legend, how do we need to include a variable Npc.

Accepted Answer
More Answers (1)
darova
on 20 Aug 2019
Concatenation?
Npc=2;
legend1 = ['\Sigma_{i=1}^{', num2str(Npc) ,'Npc} x^\prime_i'];
legend(legend1,'Total L_w','Noise');
Categories
Find more on Legend 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!