I have this from Mathematica and I want to create it in MATLAB
pointers =
Table[If[experiment[[i, 1]]^2 + experiment[[i, 2]]^2 > 1, 0, 1], {i,
1, npoints}];
The output is for example {0, 1, 1, 1, 1, 1, 0, 0, 1, 1}, for npoints = 10.
I tried this, but it's wrong! (I am learning MATLAB now, I have a little from Mathematica though)
assign=experiment(i,1)^2 +experiment(i,2)^2;
if assign>1
assign=0;
else assign=1;
end
pointers=assign(1:npoints);
I also did this which gives output 1, but it's wrong:
for i=1:npoints
assign=length(experiment(i,1)^2 +experiment(i,2)^2);
if assign>1
assign=0;
else assign=1;
end
end
pointers=assign