Clear Filters
Clear Filters

Plotting a function error

1 view (last 30 days)
Krish Desai
Krish Desai on 14 Mar 2016
Answered: Image Analyst on 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?

Accepted Answer

Image Analyst
Image Analyst on 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*-')

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!