I want to see N,M first and then K,M in the same legend. I can see only N,M like the attached picture.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matthew Worker
am 26 Mai 2021
Kommentiert: Rena Berman
am 16 Dez. 2021

clc;
clear;
N = [10 20 30 40 50];
M = [1 2 3 4 5];
K=[1 3 5 6 7];
x = linspace(0, 1, 17);
legendString = "N = " + string(N) + ", M = " + string(M);
legendString2 = "K = " + string(N) + ", M = " + string(M)+", GA ";
ph = plot(x,N.*x');
hold on
ph2 = plot(x+2,N.*x');
legend(ph,legendString)
legend(ph2,legendString2)
1 Kommentar
Akzeptierte Antwort
Alan Stevens
am 26 Mai 2021
Do you mean like this?
N = [10 20 30 40 50];
M = [1 2 3 4 5];
K=[1 3 5 6 7];
x = linspace(0, 1, 17);
legendString = "N = " + string(N) + ", M = " + string(M);
legendString2 = "K = " + string(N) + ", M = " + string(M)+", GA ";
ph = plot(x,N.*x',x+2,N.*x');
legend(ph,[legendString,legendString2])
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
