필터 지우기
필터 지우기

What's the problem?

조회 수: 2 (최근 30일)
Augusto Borges Resende
Augusto Borges Resende 2017년 10월 13일
편집: James Tursa 2017년 10월 13일
I do not know what the code problem is for not plotting:
x=-100:0.001:100;
y=3x+1./(x+2)*(x-3);
plot(x, y, 'k-', 'LineWidth', 2);
grid on;
xlabel('X', 'FontSize', 20);
ylabel('Y', 'FontSize', 20);

답변 (1개)

James Tursa
James Tursa 2017년 10월 13일
편집: James Tursa 2017년 10월 13일
You can't use 3x in MATLAB ... you have to use 3*x. And you need to use the element-wise .* operator instead of the matrix multiply * operator.
y = 3*x+1./(x+2).*(x-3);
And, if you meant for all of the (x+2)*(x-3) stuff to be in the denominator, then you would need to use parentheses:
y = 3*x+1./((x+2).*(x-3));

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by