What's the problem?

조회 수: 1 (최근 30일)
Augusto Borges Resende
Augusto Borges Resende 2017년 10월 13일
편집: Walter Roberson 2019년 11월 2일
I do not know what the code problem is for not plotting:
t=-50:1:50; y=(t.^2+9)/(t-3.^2); plot(t,y,'-k');

채택된 답변

Image Analyst
Image Analyst 2017년 10월 13일
편집: Image Analyst 2017년 10월 13일
You forgot to use dot slash to do an element by element divide:
t = -50 : 1 : 50;
y = (t.^2 + 9) ./ (t-3^2);
plot(t, y, 'k-', 'LineWidth', 2);
grid on;
xlabel('X', 'FontSize', 20);
ylabel('Y', 'FontSize', 20);
The above code works fine.

추가 답변 (1개)

Jonathan Chin
Jonathan Chin 2017년 10월 13일
I assume you wanted to do an element divide see small below
t=-50:1:50;
y=(t.^2+9)./(t-3.^2);
plot(t,y,'-k');

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by