How to avoid legend error?

3 次查看(过去 30 天)
Ezz El-din Abdullah
评论: KSSV 2017-3-16
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?

回答(1 个)

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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by