i got an error when i run this code ? Error using plot
Mostrar comentarios más antiguos
R=2;
meo=5;
ru=0:1:30*1;
syms k
Pout_k1=((2^(2*R)-1)^k).*symprod(1./(ru*5),k,1,1);
Pout_k2=((2^(2*R)-1)^k).*symprod(1./(ru*5),k,1,2);
Pout_k5=((2^(2*R)-1)^k).*symprod(1./(ru*5),k,1,5);
plot(ru,Pout_k1,ru,Pout_k2,ru,Pout_k5)
6 comentarios
Ameer Hamza
el 3 de Mayo de 2020
What is the value of 'k' in ((2^(2*R)-1)^k) on the line
((2^(2*R)-1)^k).*symprod(1./(ru*5),k,1,1);
Osama Dwairi
el 3 de Mayo de 2020
Ameer Hamza
el 3 de Mayo de 2020
Then what are you trying to do here: symprod(1./(ru*5),k,1,1)? Can you attach the image of the equations in mathematical form?
Osama Dwairi
el 3 de Mayo de 2020
Ameer Hamza
el 3 de Mayo de 2020
Editada: Ameer Hamza
el 3 de Mayo de 2020
Yes, that is obvious from symprod. But what are its limits? and what is its index variable? You can attach the image in the comment.
Osama Dwairi
el 3 de Mayo de 2020
Respuestas (1)
Ameer Hamza
el 3 de Mayo de 2020
Editada: Ameer Hamza
el 3 de Mayo de 2020
Try this code, without symbolic variables.
R=2;
meo=5;
ru=1:30;
Pout = @(k) ((2^(2*R)-1)^k).*prod(1./(ru(1:k)*5));
Pout_k1 = Pout(1);
Pout_k2 = Pout(2);
Pout_k3 = Pout(5);
1 comentario
Osama Dwairi
el 3 de Mayo de 2020
Categorías
Más información sobre Assumptions en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
