----> Proof that the results are disimilar
>> P=Test;
Elapsed time is 0.247434 seconds.
>> load Test.mat;
>> tic;P1=Cuboid(xp,yp,zp);toc
Elapsed time is 0.769585 seconds.
>> isequal(P1',P)
ans =
0
----> For similar results
function [P]=Test
% Loading Pre-Point Generation Data
load Test.mat;
---> Proof that Cuboid is faster
>> P=Test;
Elapsed time is 4.109277 seconds.
>> load Test.mat;
>> tic;P1=Cuboid(xp,yp,zp);toc
Elapsed time is 0.755397 seconds.
>> isequal(P1',P)
ans =
1
----> Cuboid=mesgrid+unique ==> to generate a structured point cloud Cuboid is still way faster.
Here is a faster version compared with the Cuboid()
%%
clear
for i=1:100
tic
[P]=Cuboid([-1:0.1:1],[-2:0.1:2],[-3:0.1:3]);
%plot3(P(1,:),P(2,:),P(3,:),'*')
toc
end
%Approx worst case: Elapsed time is 0.006052 seconds.
%%
clear
for i=1:100
tic
[x,y,z]=meshgrid([-1:0.1:1],[-2:0.1:2],[-3:0.1:3]);
x=reshape(x,[],1);y=reshape(y,[],1);z=reshape(z,[],1);
%plot3(x,y,z,'*')
toc
end
%Approx worst case: Elapsed time is 0.001026 seconds.
Both code produce the same result but using meshgird is much faster. I find it interesting as to how gather lots of points in the cloud, especially when there is OUT OF MEMORY issues.
for example: [x,y,z]=meshgrid([-1:0.001:1],[-1:0.001:1],[-1:0.001:1]); gives OUT OF MEMORY.
I am thinking of taking only X and Y using meshgrid and using this to create slices of the cube in the x-y plane. Any better ways to overcome the OUT OF MEMORY problems ?
Hi Jveer,
the MATLAB code should work on mac osx. However, you will need to modify qsub_submit_cm.m and qsub_check_finish.m. You will have to replace the qsub and qstat calls with their xgrid equivalents.
In qsub_submit_cm, you will have to replace the qsub command line call with the appropriate call to "xgrid ... -job submit ...", and in qsub_check_finish.m you would replace the qstat calls with "xgrid ... -job status ..." or something like this.
I do not have any experience with mac osx or xgrid, but it should be fairly straightforward to adapt these calls. If you have any questions, feel free to ask. If you get this code to run, it would be nice to let me know about the appropriate xgrid commands.
Comment only