I want to generate an array of number using for-end, i know that I can generate logarithmic series using logspace, but in this case, i can't use that
so I run this code:
function y=generatefor i=1:20 j(i)=10^((i-1)/2); for l=1:5; y(l)=j(i)+l/5*j(i)*sqrt(10); end endresult1=[y'];
my expectation is that I can generate logarithmic series of 100 number from 10^0 to 10^9.5, but instead getting 100 numbers, I run it and only get these:
ans = 1.0e+010 * 0.5162 0.7162 0.9162 1.1162 1.3162
then what should I do to get the 100 numbers, I need the '20' on 'i=1:20' in other function, that's why i can't use logspace because logspace can't be use inside looping command (for-end). Please I need your advice and I am just a beginner.
I appreciate your help
Best Answer