[2017b] how to solve "Error using matlab.graphics.chart.primitive.Line/horzcat Cannot convert double value -5.21739 to a handle".
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Amra Rajuli
am 15 Apr. 2018
Kommentiert: Amra Rajuli
am 16 Apr. 2018
[X,Y,Z] = peaks;
figure
L3 = contour(X,Y,Z,10);
hold on
q = 0;
L1= plot (xlim,[1 1]*q,':b','LineWidth',2);
a=0
L2= plot ([1 1]*a,ylim,':k','LineWidth',2);
legend([L2 L3],{'First Time Arrival','Maximum wave peak'})
Hi..I want to show legend of particular plotted items only. But then I got error message as follow "Error using matlab.graphics.chart.primitive.Line/horzcat Cannot convert double value -5.21739 to a handle". How to solve it? Thank you
2 Kommentare
Akzeptierte Antwort
Jan
am 15 Apr. 2018
Replace
L3 = contour(X,Y,Z,10);
by
[~, L3] = contour(X,Y,Z,10);
The first output of contour is the contour matrix, not the wanted handle.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!