Effacer les filtres
Effacer les filtres

integration error in matlab

1 vue (au cours des 30 derniers jours)
nikhil
nikhil le 11 Mai 2020
Commenté : nikhil le 11 Mai 2020
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

Réponse acceptée

Walter Roberson
Walter Roberson le 11 Mai 2020
Always use ./ instead of / unless you intend to do algebraic matrix division similar to A/B meaning A matrix-multiply pinv(B)
  1 commentaire
nikhil
nikhil le 11 Mai 2020
thanks for the suggestion

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by