New answers tagged

2

Another approach is to use the fact that true is equal to $1$ and false is equal to $0$. If both conditions in the if statement are met, the result is $1$, otherwise it's $0$. segs = 1000000; r_int = 100; r_ot = 2000; x = linspace (0, 1000, segs); y = linspace (0, -1000, segs); [xx, yy] = meshgrid (x, y); circ = xx.*yy; circ_matrix = ( r_int<=circ ) .* (...


2

rmid = 0.5*(r_int + r_ot); rlen = 0.5*(r_ot - r_int); cc = double(abs(circ - rmid) <= rlen);


Top 50 recent answers are included