integration error in matlab

조회 수: 2 (최근 30일)
nikhil
nikhil 2020년 5월 11일
댓글: nikhil 2020년 5월 11일
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

채택된 답변

Walter Roberson
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)
  댓글 수: 1
nikhil
nikhil 2020년 5월 11일
thanks for the suggestion

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by