Undefined function 'times' for input arguments of type 'cell'.
이전 댓글 표시
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?
답변 (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);
카테고리
도움말 센터 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!