Undefined function 'times' for input arguments of type 'cell'.
Show older comments
clear; clc;
syms F m w0 w
F=1.0;
m=1.0;
w0=1.0;
w=0.9;
t=0:40*pi;
y={(2*F)/(m*((w0)^2-w^2))}.*sin(((w0)+w)/2.*t).*sin(((w0)-w)/2*t);
plot(t,y)
I tried to plot this equation, but it said Undefined function 'times' for input arguments of type 'cell'. and i don't know what's wrong with it. what should i do for ploting this equation?
Answers (1)
y={(2*F)/(m*((w0)^2-w^2))}.*...
y = ((2*F)/(m*((w0)^2-w^2))) .* ...
y = (2*F) / (m*((w0)^2-w^2)) .* ...
Tip: too many brackets does not make code clearer, it makes it harder to read. Compare:
y = ((2*F)/(m*((w0)^2-w^2))) .* sin(((w0)+w)/2.*t).*sin(((w0)-w)/2*t);
y = (2*F) / (m*(w0^2-w^2)) .* sin((w0+w)/2.*t) .* sin((w0-w)/2*.t);
Categories
Find more on Function Creation 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!