Reason for line not plotting?
조회 수: 1 (최근 30일)
이전 댓글 표시
x = 1:10:100;
y = (((20*x+35000)/(70))-1)/x;
plot(x,y)
I was wondering why the above code does not plot the function, y? As soon as the x is put in the denominator the function refuses to plot.
댓글 수: 2
Stephen23
2018년 9월 9일
y = (((20*x+35000)/(70))-1)./x;
^^ you need this!
You need to learn about array and matrix operations:
채택된 답변
madhan ravi
2018년 9월 9일
편집: madhan ravi
2018년 9월 9일
Use element wise operation because as you defined x as a vector you should use dot it means each element is calculated one by one.
x = 1:10:100;
y = (((20*x+35000)/(70))-1)./x;
plot(x,y)
댓글 수: 1
madhan ravi
2018년 9월 9일
편집: madhan ravi
2018년 9월 9일
if it solved the issue, please accept the answer
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!