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 comentario

Martin Olafsen
Martin Olafsen el 27 de Sept. de 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

Iniciar sesión para comentar.

 Respuesta aceptada

KSSV
KSSV el 27 de Sept. de 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 comentarios

Haseeb Ahmed Janjua
Haseeb Ahmed Janjua el 27 de Sept. de 2017
thanks it works
god bless you
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua el 27 de Sept. de 2017
please check your gmail email id. I need help in Some patterns
will be grateful on your feedback

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 27 de Sept. de 2017

Comentada:

el 27 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by