我有 3 个数组,在一维问题中
A, B, C = arrays (1-100)
一维网格,网格点之间的距离 = a
我需要用 Matlab 代码编写下一个数学表达式:
E = A^(-1/3) * ( D/Dx (B * ((DC/Dx)^(1/3)) )
我把它写成:
DCDx = gradient(C, a);
e1 = B * ( DCDx ^ (1/3) );
e2 = gradient(e1 , a);
E = A^(-1/3) * e2;
编辑 :
for i:length(B)
DCDx = gradient(C, a);
e1 = B.* ( Root(DCDx) );
e2 = gradient(e1 , a);
E = ( Root(A) )^(-1).* e2;
end
where Root, is my function
function X = Root(X)
X = nthroot(X,3)
unfortunately still is not working.
error = "Matrix dimensions must agree."
any idea?