FillPattern of a Rectangle

조회 수: 9 (최근 30일)
Mehran Naghizadehrokni
Mehran Naghizadehrokni 2020년 3월 1일
답변: Guillaume 2020년 3월 1일
I found a function for drawing a rectangle and filling with DiagonalLines. Below is the function:
plot::Rectangle(xmin .. xmax, ymin .. ymax, <a = amin .. amax>, options)
However, the problem is when I write this function I receive the error message:
Invalid use of operator.
Even I tried the example of Matlab but again I got the same eror message.
  댓글 수: 2
Guillaume
Guillaume 2020년 3월 1일
As per your link, that function works in a mupad notebook (which are now deprecated), so obvious question: Are you using it in a mupad notebook? If you aren't and are trying that at the matlab command prompt or in a matlab script/live script/function then yes, you're going to have errors. The function is not available there.
Mehran Naghizadehrokni
Mehran Naghizadehrokni 2020년 3월 1일
Yes, you write, I am using this code in matlab script. So what can I if I want to add a rectangle to my curve and fill it with DiagonalLines?
dim = [0.38 .111 .09 .814];
annotation('rectangle',dim,'FaceColor','blue','FaceAlpha',.2)
I already used this code and it worked, but the problem is I want to fill it with diagonal line, not solid colour.

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

채택된 답변

Guillaume
Guillaume 2020년 3월 1일
Unfortunately for you, there is no such function in matlab. You may search the FileExchange to see if somebody has implemented something like that, otherwise I'm afraid you'll have to draw the diagonal lines yourself with a bunch of line calls in addition to the rectangle call.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by