Perfect and snappy, meshgrid surprises me with a new use every day! Thanks Sven.
The one thing I would add to that for anyone else is to match up the points with the meshgrid size, something like;
pts = rand(10,3) * M
What I would really like is a quick way of generating an MxMxM matrix of say binary values: 1 = in a sphere, 0 = otherwise. Is there a quick way of doing this? I can think of some ways, but they're all bracketed in far too many for loops;
for a=1:M
for b=1:M
for c=1:m
[code to check to see if this point is in a sphere]
end
end
end
kind of structure.
@remidalmas - how exactly did it not work? I'd like to get it working for you. Did I forget to include a file? If you could copy-paste the error message here it would help me and others out. Thanks!
@remidalmas - how exactly did it not work? I'd like to get it working for you. Did I forget to include a file? If you could copy-paste the error message here it would help me and others out. Thanks!
@remidalmas - how exactly did it not work? I'd like to get it working for you. Did I forget to include a file? If you could copy-paste the error message here it would help me and others out. Thanks!
Comment only