represent exponential function in app designer
2 ビュー (過去 30 日間)
古いコメントを表示
How can I put the initial condition to the functions y1 and y2? Because the interface doesn't draw in the axes the function that I want and maybe it is due to the fact that my code doesn't have the initial condition, this is my code:
P = app.P.Value;
Q = app.Q.Value;
Xo = app.Xo.Value;
Yo =app.Yo.Value;
a = app.a.Value;
b = app.b.Value;
Ky = Yo-P/a;
Kx = Xo-Q/a;
C2 = (Ky.*sqrt(a/b)+Kx)/(2.*sqrt(a/b));
C1 = Ky-C2;
x = 0:0.2:100;
y1 = (- C1*sqrt(a/b)*exp(sqrt(a*b)*x) + C2*sqrt(a/b)*exp(-sqrt(a*b)*x)) + Q/b;
plot (app.Axes,x,y1,'k')
y2 = (C1*exp(sqrt(a*b)*x) + C2*exp(-sqrt(a*b)*x)) + P/a;
hold (app.Axes, 'on');
plot (app.Axes,x,y2,'g')
hold (app.Axes,'off')
thanks!
0 件のコメント
回答 (1 件)
Abhishek Chakram
2023 年 10 月 11 日
Hi Alvaro Mª Zumalacarregui Delgado,
It is my understanding that you want to add initial conditions to the functions y1 and y2. Here is an example for the same:
x = 1:10;
y1_initial = 0; % Intial y1 value
y2_initial = 4; % Intial y2 value
y1 = [y1_initial,cos(x)]; % Assigning intial y1 value
y2 = [y2_initial,sin(x)]; % Assigning intial y2 value
plot(y1,y2,'*');
In this example, “y1_initial” and “y2_initial” are the initial conditions for the functions “y1” and “y2”.
Best Regards,
Abhishek Chakram
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!