Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

i made some changes but error is coming ..plz help

1 vue (au cours des 30 derniers jours)
khushi
khushi le 18 Août 2015
Clôturé : MATLAB Answer Bot le 20 Août 2021
clc;
clear all;
k=1;
g=0.01:.1:6;
lambda=2;
b=2;
c=1;
l=2;
T=zeros(size(0.01:0.1:6));
ix=0;
for x=0.01:.1:6
P=(0.5*lambda)/((b^(lambda*c))*gamma(c));
Q=((k^0.5)*l^(lambda*c-0.5)).*g.^(-lambda*c)/((2*pi)^(0.5*(l+k)-1));
R=evalin(symengine, sprintf('meijerG([[1],[]], [[1,0.5],[]],%f)',x^2));
ix=ix+1;
T(ix)=P*Q*R;
end
plot(g,T)

Réponses (1)

Walter Roberson
Walter Roberson le 18 Août 2015
Your Q is now defined in terms of g, and your g is a vector, so your Q is now a vector for every iteration of x. Your P and R are scalars so P*Q*R is a vector the same length as g. You are trying to save that vector into the single element T(ix). Are you expecting a vector for each x value?
  2 commentaires
khushi
khushi le 18 Août 2015
Yes
Walter Roberson
Walter Roberson le 18 Août 2015
T(ix,:)=P*Q*R;

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by