Effacer les filtres
Effacer les filtres

getting error as Matrix dimensions must agree.

1 vue (au cours des 30 derniers jours)
nikhil
nikhil le 15 Mai 2020
Commenté : nikhil le 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 commentaires
Ameer Hamza
Ameer Hamza le 16 Mai 2020
Can you show your integral equation in MATLAB form? You can attach it as an image.
nikhil
nikhil le 16 Mai 2020
Sir, i consider only integral part of equation

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 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
  1 commentaire
nikhil
nikhil le 16 Mai 2020
Thanks sir, code is working properly

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming 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