Draw the graph by calling the script

조회 수: 1 (최근 30일)
인범 황
인범 황 2021년 11월 5일
답변: Sudharsana Iyengar 2021년 11월 5일
I want to load two scripts and display them in one graph.
What should I do?

답변 (1개)

Sudharsana Iyengar
Sudharsana Iyengar 2021년 11월 5일
Ok let me give you a simple script that will do this work for you.
function drawscript(x,y)
plot(x,y)
set(gca,'TickLength',[0.02,0.025],'XMinorTick','on','YMinorTick','on','XMinorGrid','off','YMinorGrid','off','YAxisLocation','right');
end
Now this will be saved as drawscript. call it whenever you want to plot.
x=linspace(0,90,1000);
y=sin(x)
drawscript(x,y)
Now when you execute the above command then plot will be drawn. You can change your default ploting parameters by adding other things also. for instance changing it to log or no ticks no labels etc or marker size.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by