I keep getting this error for my script:
'Error in subplot (line 7) subplot(2,2,1)'.
Can anybody help me pls?
clear;
clc;
t = linspace(0,4*pi);
x = 2*sin(t);
y = 2*sin(t);
subplot(2,2,1)
plot(t , x , 'color' , 'm');
hold on
plot(t , y , 'color' , 'c');
subplot(2,2,2)
plot(t , x+y , 'color' , 'y');
subplot(2,2,3)
plot(t , x-y , 'color' , 'g');
subplot(2,2,4)
plot(t , x , 'color' , 'm');
hold on
plot(t , -y , 'color' , 'c');

댓글 수: 2

madhan ravi
madhan ravi 2019년 3월 10일
paste the complete error message that you get
this is the whole error message:
Attempt to execute SCRIPT subplot as a function:
D:\University\ترم 6\آز مدار\تصاویر لیساژو\subplot.m
Error in subplot (line 7)
subplot(2,2,1)

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

 채택된 답변

madhan ravi
madhan ravi 2019년 3월 10일

0 개 추천

You have a filenamed subplot.m which shadows the function named subplot() please remove it from the path or delete it.

추가 답변 (0개)

카테고리

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by