Filter löschen
Filter löschen

getting error as Matrix dimensions must agree.

1 Ansicht (letzte 30 Tage)
nikhil
nikhil am 15 Mai 2020
Kommentiert: nikhil am 16 Mai 2020
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 Kommentare
Ameer Hamza
Ameer Hamza am 16 Mai 2020
Can you show your integral equation in MATLAB form? You can attach it as an image.
nikhil
nikhil am 16 Mai 2020
Sir, i consider only integral part of equation

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Mai 2020
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

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by