How to plot square root of a function?
이전 댓글 표시
I tried plotting the square root of an function. I expect the plot to be curved, but I get a straight line. What am I doing wrong?
x1 = 0:1:10;
y = sqrt(1-(x1).^2);
plot(x,y)
채택된 답변
추가 답변 (1개)
Steven Lord
2022년 6월 3일
0 개 추천
Your first two lines define and use a variable x1 but your third uses a variable named x that is not defined in your code. What is the definition of x?
카테고리
도움말 센터 및 File 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!
