how can i solve this proplem? its keep saying not enough input argument when i put the plot option
조회 수: 2 (최근 30일)
이전 댓글 표시
close all;
clear all; %#ok<CLSCR>
clc;
syms t y(t);
m=input('specify the power value');
u=(t.*sin(3.*t)).^m;
z=int(u,0,exp(t));
w=diff(u,t,2);
a=laplace(w);
dy1=diff(y,t,1);
dy2=diff(y,t,2);
L=length(m);
y(t)=dsolve(dy2-(5*dy1)+(4*y)==randi([1,L]),dy2==0,dy1(0)==0);
q=laplace(y(t));
subplot(1,6,1),ezplot (u);
subplot(1,6,2),ezplot (z);
subplot(1,6,1),ezplot (w);
subplot(1,6,2),ezplot (y(t));
subplot(1,6,2),ezplot (q);
subplot(1,6,1),ezplot (a);
댓글 수: 0
답변 (1개)
Johnathan Schaff
2018년 3월 12일
Your code ran on my machine, but the error you posted seemed to point to the ezplot function. Looking at the documentation for ezplot, the two types of inputs that it supports are function handles and character vectors. However, there is another version of the ezplot function specific to the symbolic toolbox that will support sym input. You could try using the fplot function in place of ezplot to plot symbolic functions, but that could also run into the same problem. An alternative could be to utilize the subs function and evaluate over a specified range
figure()
range = -5:0.01:5; %Typical numerical evaluation for fplot
plot(range,eval(subs(u,range)))%Where u is a symbolic expression
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!