
What's the problem?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Augusto Borges Resende
il 13 Ott 2017
Modificato: Walter Roberson
il 2 Nov 2019
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');
0 Commenti
Risposta accettata
Image Analyst
il 13 Ott 2017
Modificato: Image Analyst
il 13 Ott 2017
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.

0 Commenti
Più risposte (1)
Jonathan Chin
il 13 Ott 2017
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');
0 Commenti
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!