How to solve following difference equation using Matlab
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
Please help me to solve following difference equations using Matlab
p(n)= p(n-1) + (1- p(n-1)) * p(0)
p(n)= p(n-1) * gamma^k
with initial conditions
p(0) =1, gamma= [0,1]
also from both equations
gamma= (1-(1-p(n-1))/p(n-1)* p(0))^ (1/k).
How this can be solved and plot using Matlab.
0 commentaires
Réponses (1)
Walter Roberson
le 17 Jan 2016
You have gamma= [0,1] which is a vector. You have gamma^k . You cannot raise a vector to a power in MATLAB: you can only raise square matrices to a power. You could raise each element of the vector to a power, gamma.^k but that is going to return a vector result, which implies that the output of p(n) would have to be a vector, and then you would fail the multiplications the next time around. Unless you changed them to element-by-element multiplications...
0 commentaires
Voir également
Catégories
En savoir plus sur Gamma Functions 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!