how to create diagonal stripes in a specific area of plot

12 ビュー (過去 30 日間)
gpr
gpr 2020 年 7 月 8 日
編集済み: jonas 2020 年 7 月 8 日
Hi, I'd like to create some grid of diagonal stripes in an area of a plot (it's easy to define this area, I need this for x 0-->5, and for y: 0-->60).
I can use this for the horizontal lines:
[dotsX,dotsY] = ndgrid(linspace(0, 5, 15), linspace(0, 60, 15));
But, how can I adapt it to make the lines diagonal?
Thanks in advance

回答 (1 件)

jonas
jonas 2020 年 7 月 8 日
編集済み: jonas 2020 年 7 月 8 日
Try this FEX function
This could also work
for i = -size(dotsX,1):size(dotsX,1)
plot(diag(dotsX,i),diag(dotsY,i),'k-');hold on
end

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by