MATLAB: Logspace equivalent and sin(x) [solved]

:equivalentlinspacelogspace

Hello, I have to solve a couple of exercises; the first one asks me to write with ":" the equivalents of this:
x=linspace(0, 10, 5);
x=linspace(-5, 5);
x=logspace(1, 3, 3);
x=logspace(1, 3, 5);
I solved the first by myself ( x=[0:2.5:10] ) because it's easy, but I really can't understand the others; actually I don't just want to solve the exercises but I want to understand if there is actually a method and how it is done.
Second one is this: A = {sin(x), x=1,2, ,1000}, I have to find how many elements of A are bigger than 1/2 using function SUM; actually I don't know that writing, I just started using Matlab, but even Matlab gives me an error, so maybe I thought it was wrong written; any guesses?

Best Answer

x = 10.^(1:3) % x=logspace(1, 3, 3)
result = sum(A>0.5) % Number of elements in A bigger than 0.5