How to plot x and y

Risposte (2)

Dave B
Dave B il 10 Ott 2021
Modificato: Dave B il 10 Ott 2021
There are a couple of options for how you think about this problem. I might do it like this:
t = 0:100; % you could just do [0 100] because everything is linear...
plot(3*t,2*t)
But an alternative is to use the fplot function which takes in functions directly (rather than functions applied discretely to a set of points):
figure
fplot(@(t)(3*t),@(t)(2*t),[0 100])
More info can be found at the documentation pages for plot and fplot:

Categorie

Tag

Richiesto:

il 10 Ott 2021

Modificato:

il 10 Ott 2021

Community Treasure Hunt

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

Start Hunting!

Translated by