2016-10-26 4 views

答えて

2

あなたが各2セットのためplotを繰り返すarrayfunを使用することができます。

x = 0:0.2:1; 
y = 0:0.2:1; 
figure;hold on; 
plot(x,y, '-o','LineWidth', 2); 
arrayfun(@(xx,yy)plot([xx xx],[0 yy],'r'),x,y) 
arrayfun(@(xx,yy)plot([0 xx],[yy yy],'r'),x,y) 
grid on; 

enter image description here

関連する問題