Hey,if anyone of you are good at matlab that\'d be great. What ONE line of code
ID: 2900503 • Letter: H
Question
Hey,if anyone of you are good at matlab that'd be great. What ONE line of code can be used in matlab to create the following vectors. I am going to give what the output looks like. Thanks, and the hint was to use built in functions for vectors like ones, zero, eye, sum, etc. and the maybe multiple/divide them by a value or use colon operators. Remember one line of code, and it can't be given explicitly( i.e. you have to find the pattern in the sequence.)
1. A = 1 4 9 16 25 36 49 64
2.B=0.5000 0.2500 0.1667 0.1250 0.1000
Thanks
Explanation / Answer
a=[1:8].^2;
Q2.b=1./[2:2:10];