Filter löschen
Filter löschen

How to avoid legend error?

3 Ansichten (letzte 30 Tage)
Ezz El-din Abdullah
Ezz El-din Abdullah am 14 Mär. 2017
Kommentiert: KSSV am 16 Mär. 2017
I keep receiving this error:
Error using vertcat
Dimensions of matrices being concatenated are not consistent.
I solve it by making the length of the string the same. Like this example:
legend(['x9';'x10']) %this will produce the error
legend(['x9_';'x10']) %solution
But this is not what I want especially when the string gets lengthy. So please, is there another solution?

Antworten (1)

KSSV
KSSV am 15 Mär. 2017
Bearbeitet: KSSV am 15 Mär. 2017
legend(['x9' ,'x10'])
  2 Kommentare
Ezz El-din Abdullah
Ezz El-din Abdullah am 15 Mär. 2017
How can it be a row vector?!
It will then produce just one legend (with the same color)
KSSV
KSSV am 16 Mär. 2017
Yes you are right....This will work.
legend({'x9' ; 'x10'})

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by