Multiple plots in one m file
이전 댓글 표시
Hello all, my .m file includes multiple plots. When I run the code only the last plot figure shows up and overwrites all previous plots. Any suggestion on how to manage this ?
Many thanks
댓글 수: 1
채택된 답변
추가 답변 (2개)
Dimitris Kalogiros
2018년 9월 3일
Before using plot() command you should place a "figure" command
For example:
clc; clear; close all;
t=0:0.1:10;
x=sin(2*pi*3.*t);
y=sqrt(t)+cos(2*pi.*t);
figure;
plot(t,x,'-b'); zoom on; grid on;
figure;
plot(t,y,'-r'); zoom on; grid on;
카테고리
도움말 센터 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!