getting error as Matrix dimensions must agree.

조회 수: 1 (최근 30일)
nikhil
nikhil 2020년 5월 15일
댓글: nikhil 2020년 5월 16일
Hi all,
i am trying to solve the above equation in matlab, but i am getting an error as matrix dimensions must agree while solving the code
any suggestions and thanks in advance
clc;
clear;
format short;
ro = 17.5; % op.ra
R = 65; b= 1.225*ro; % radius of cylinder
r = b:5:R; % let us divdie r values into two section upto b point
ro_bar= ro/R; %dimensionless variable
x1 = r/R; % set of point from radius and b point
b1 = ro:0.45:b;
r_b1 = b1/R; % set of points from b point to op.ra
alp= asind(ro/R);
% let us make two divisions
func1 = @(r)((r.^3)./(sqrt((x1).^2) - ((ro_bar).^2) - (((x1).^6).*(1-((ro_bar).^2)))));
i = zeros(size(x1));
for c = 1:length(x1)
i(c) = integral(func1,0,x1(c));
end
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 5월 16일
Can you show your integral equation in MATLAB form? You can attach it as an image.
nikhil
nikhil 2020년 5월 16일
Sir, i consider only integral part of equation

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 5월 16일
ro = 17.5; % op.ra
R = 65; b= 1.225*ro; % radius of cylinder
r = b:5:R; % let us divdie r values into two section upto b point
ro_bar= ro/R; %dimensionless variable
x1 = r/R; % set of point from radius and b point
b1 = ro:0.45:b;
r_b1 = b1/R; % set of points from b point to op.ra
alp= asind(ro/R);
i = zeros(size(x1));
for c = 1:numel(x1)
func1 = @(r)((r.^3)./(sqrt((x1(c)).^2) - ((ro_bar).^2) - (((x1(c)).^6).*(1-((ro_bar).^2)))));
i(c) = integral(func1,0,x1(c));
end

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by