MATLAB: I have one variable which has value in an array and i want to make the power of all the value of array by another variable but getting value zero.any possible solution

MATLABprecisionsymsymbolicSymbolic Math Toolbox

alpha = [0.01 0.01 0.01 0.01]
lambda = 195
for i = 1 : 4
K(i) = alpha(i).^lambda;
end

Best Answer

sym(alpha).^lambda % no loops needed
Gives:
ans =
1/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,... % same repeats likewise