Azzera filtri
Azzera filtri

Plotting a function error

1 visualizzazione (ultimi 30 giorni)
Krish Desai
Krish Desai il 14 Mar 2016
Risposto: Image Analyst il 14 Mar 2016
I'm trying to plot the following: y=((e^(-6t))/6)*(1-9e^(6t)+14e^(6t)
t=-10:1:10;
plot (t,((exp(-6*t))/6)*(1-9*exp(4*t)+14*exp(6*t)))
but the error message "inner matrix dimensions must agree" pops up. What a I doing wrong?

Risposta accettata

Image Analyst
Image Analyst il 14 Mar 2016
Whever you see that, try using dots before the mathematical operators. In other words, use .* instead of *
t=-10:1:10;
y = (exp(-6*t) / 6) .* (1-9*exp(4*t)+14*exp(6*t))
plot(t, y, 'b*-')

Più risposte (0)

Categorie

Scopri di più su Line Plots 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!

Translated by