“Добавить переменную к легенде Matlab” Ответ

Добавить ручную легенду Matlab

h1=plot([1:10],'Color','r','DisplayName','This one');hold on;
h2=plot([1:2:10],'Color','b','DisplayName','This two');
h3=plot([1:3:10],'Color','k','DisplayName','This three');
legend([h1 h3],{'Legend 1','Legend 3'})
Breakable Booby

Добавить переменную к легенде Matlab

str = {strcat('z = ' , num2str(z))}  % at the end of first loop, z being loop output
str = [str , strcat('z = ' , num2str(z))] % after 2nd loop
% plot your data
legend(str{:})
chink

Ответы похожие на “Добавить переменную к легенде Matlab”

Вопросы похожие на “Добавить переменную к легенде Matlab”

Смотреть популярные ответы по языку

Смотреть другие языки программирования