How to apply an equation to each element in the array?
10 次查看(过去 30 天)
显示 更早的评论
采纳的回答
更多回答(1 个)
Image Analyst
2021-11-28
Try conv2():
k = 10^-7 % filtration of soil
M = 19000
q = 80 % external force Q acting on soil
DeltaZ = 0.1 % depth of soil subsidization
GammaW = 10 % water weight [Kn/m^3]
Cv = k*M/GammaW % consolidation factor
DeltaT = DeltaZ^2/(2*Cv) % max iteration step
alpha = Cv*DeltaT/DeltaZ^2
% NUMERICAL PARAMETERS
u = q*ones(10:10) % matrix of u nodes
% SOLUTION
kernel = [0, 1, 0] + alpha * [1, -2, 1]
% Discrete form of the governing equation:
soilSub = conv2(u, kernel) % Use conv2(), not conv()
4 个评论
Image Analyst
2021-11-28
No problem. I'm sure using conv() instead of conv2() was just an oversight by Matt. I know he knows better - he's a bright guy. You can vote for multiple answers though you can only Accept one. You can even vote for one you Accepted to award double the reputation points to that one.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!