Effacer les filtres
Effacer les filtres

index exceeds matrix dimension

1 vue (au cours des 30 derniers jours)
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua le 27 Sep 2017
whenever I create this function in editor
function r = Ymaxfinal(p,q)
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p(p+(2*q)))^0.5);
end
but when I call it in command window like Ymaxfinal(9,8)
it gives the error of Index exceeds matrix dimensions. plz help me
  1 commentaire
Martin Olafsen
Martin Olafsen le 27 Sep 2017
You're missing a multiplication ("*").
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3* --->p<---(p+(2*q)))^0.5);
Use this: r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p*(p+(2*q)))^0.5);
Regards

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 27 Sep 2017
Change this line:
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p(p+(2*q)))^0.5);
to
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p*(p+(2*q)))^0.5);
  2 commentaires
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua le 27 Sep 2017
thanks it works
god bless you
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua le 27 Sep 2017
please check your gmail email id. I need help in Some patterns
will be grateful on your feedback

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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