can someone help me run this

3 次查看(过去 30 天)
Relly Syam
Relly Syam 2021-5-7
%
clear;
clc;
format long g
syms c0 c1 c2 c3 t r0 r1 r2 r3
c0=0; c1=1/3; c2=2/3; c3=1; r0=0; r1=1; r2=2; r3=3;
EvalAt = [c0, c1, c2, c3];
ktemp = arrayfun(@(EA) euler([r0, r1, r2, r3], EA).', EvalAt, 'uniform', 0);
ptemp=arrayfun(@(EA) int(euler([r0, r1, r2, r3],t), 0,EA).', EvalAt, 'uniform', 0);
E = horzcat(ktemp{:}).'
K = horzcat(ptemp{:}).'
Ek=E-K
Inv_Ek= inv(Ek)
F=[6*c0-3*c0^2;6*c1-3*c1^2;6*c2-3*c2^2;6*c3-3*c3^2]
C=inv(Ek)*F
%solusi aproximasinya
Ua=@(x)(C(1)*euler(0,x)+C(2)*euler(1,x)+C(3)*euler(2,x)+C(4)*euler(3,x))
uaa=[];
xx=[];
k=0;
for i=1:4
uaa(i)=Ua(k);
xx(i)=k;
k=k+.1;
end
uaa'
  2 个评论
KSSV
KSSV 2021-5-7
Whjat help you want? Code runs without any errors.
Relly Syam
Relly Syam 2021-5-7
I ran the code above on matlab mobile, and the result was not error. I am a little confused, I have been trying to approximate an integral with a certain method but have found the above results. Is that done?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by