Calculate Exponentials WITHOUT built-in exponent function?
Afficher commentaires plus anciens
Greetings!
I am new to MATLAB and going in circles trying to logic my way what should be a simple function:
How do I calculate, using a "for" loop, x^k?
My function inputs are ( x, n ); I start with:
% code
ExpValue = 0;
k = 1;
for i = 1:n;
ExpValue = ExpValue + ?
end
Recall that I must use a Sum for the exponential function... x*1, x*x, x*x*x all the way to squaring x up to n times.
Thanks!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!