I was trying to plot a sine wave in matlab but it keeps on showing this error: undefined function or method 'sin' for input types of argument 'char'
조회 수: 2 (최근 30일)
이전 댓글 표시
t=0:0.001:10:
x= sin(4*pi*t);
plot(t,x)
댓글 수: 0
답변 (1개)
John Chilleri
2017년 1월 22일
편집: John Chilleri
2017년 1월 22일
You have a colon after t = 0.0:0.001:10: <-
t = 0:0.001:10;
x = sin(4*pi*t);
plot(t,x)
The above code works for me.
Also, make sure you haven't used pi as a variable name. My guess is that you have assigned a string or character to pi.
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!