integration error in matlab
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/292067/image.jpeg)
Hi all,
i am trying to solve the above equation in matlab, but i am getting an error as Error in integralCalc while solving the code
any suggestions and thanks in advance
clc;
clear;
ro = 17.5; R = 65;
a1 = 1/2*((((1+4*(ro.^2))/(1-(ro.^2))).^(1/2)) -1);
a2 = -1/2*((((1+4*(ro.^2))/(1-(ro.^2))).^(1/2)) -1);
% let X0<x<1.22*X0 replace X0 with ro and 1.22*X0 as b
b = 1.22*ro;
% first condition R (main radius = 65) R>r>b
x = b:5:R;
y = ro:0.45:b;
func1 = @(x)((-x.^3)/((1-x.^2).*((x.^2)-a1).*((x.^2)-a2)).^(1/2));
i = zeros(size(x));
for c = 1:length(x)
i(c) = integral(func1,0,x(c));
end
func2 = @(y)((-y.^3)/((1-y.^2).*((y.^2)-a1).*((y.^2)-a2)).^(1/2));
i = zeros(size(y));
for c = 1:length(y)
i(c) = integral(func1,0,y(c));
end
0 件のコメント
採用された回答
Walter Roberson
2020 年 5 月 11 日
Always use ./ instead of / unless you intend to do algebraic matrix division similar to A/B meaning A matrix-multiply pinv(B)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Computations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!