How to draw multiple constant lines?

조회 수: 24 (최근 30일)
Yasuyuki Hamanaka
Yasuyuki Hamanaka 2021년 5월 29일
댓글: Cris LaPierre 2023년 2월 21일
I want to draw multiple constant lines in a figure. I coded below using xline() and yline() refering Vertical line with constant x-value - MATLAB xline (mathworks.com). But it doesn't work. Would you tell me what is wrong?
xline([1,2,3]);

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 5월 29일
Could you provide more details about what you mean by 'it didn't work'?
xline([1,2,3]);
xlim([0 5])
  댓글 수: 2
Peter
Peter 2023년 2월 21일
편집: Peter 2023년 2월 21일
Has the ability to include multiple lines changed from Matlab 2020b to 2021a?
I get "Passing multiple values to ConstantLine is not supported." when I try to include multiple x-coordinates to xline.
I'm able to do it in 2021b.
Cris LaPierre
Cris LaPierre 2023년 2월 21일
Yes. The ability to include a vector of inputs to xline and yline was added in R2021a.
See the corresponding release notes.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Yasuyuki Hamanaka
Yasuyuki Hamanaka 2021년 5월 29일
편집: Yasuyuki Hamanaka 2021년 5월 29일
When I code like this
clear;
xline([1,2,3]);
error happen.
Error using xline (line 29)
Passing multiple values to ConstantLine is not supported.
Error in test (line 2)
xline([1,2,3]);
I am using R2020b now. Should I install R2021a?
  댓글 수: 3
Yasuyuki Hamanaka
Yasuyuki Hamanaka 2021년 5월 29일
I'm using R2020b version: 9.9.0.1592791 Update 5.
I'm going to install R2021a and try it. Thank you.
Katherine Zheng
Katherine Zheng 2022년 2월 24일
I am using R2021a, but still have this issue. ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by