First time user of Matlab having issues trying to plot: y=sin x/x on an interval -30<x<30.
이전 댓글 표시
Below is the code below I created and when I enter it at the >> prompt in the Command window, nothing happens and no graph appears.
x=linespace(-30,30,10001);
y=sin(x)./x;
plot(x,y,'-');
axis([-30 30-1 1])
xlabel('x')
ylabel('y')
title('Fred Smith')
1-is the code correct and do I need to create an m-file ->enter the code then save -> then type in the file name at the >> prompt for it to run. I know this is very basic but I was given the assignment without ever using Matlab and I have been researching this for hours. Thanks
채택된 답변
추가 답변 (1개)
VISHNU VARDHAN REDDY B
2020년 10월 5일
0 개 추천
fontSize = 25;
xlabel('x', 'FontSize', fontSize)
ylabel('y', 'FontSize', fontSize)
title('Fred Smith', 'FontSize', fontSize)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!