01-07-2016 07:40 PM
Hello i am trying to run the next code in labview 8.5 and i know this code is good because I executed in matlab and everything was fine, but in the line where say "axis" labview say "Error 90046" and i dont understand the reason. Somoene knows what is happening? labview can't run 3D map with mathscript?
n=500;
x=[20,4,6];
y=[10,8,90];
z=[16,2,50];
color=rand(n,3);
hold on
axis([min(x) max(x) min(y) max(y) min(z) max(z)])
for i=1:length(x);
plot3(x(i),y(i),z(i),'*','color',color(i,:))
axis([min(x) max(x) min(y) max(y) min(z) max(z)])
end
axis([min(x) max(x) min(y) max(y) min(z) max(z)])
xlabel('X');
ylabel('Y');
zlabel('Z');
view(36,18)
grid on
hold off
01-11-2016 07:04 PM
There are several issues in your code.
1. The first call to axis returns error since there is no 3D plot at that time.
2. hold does not work on 3D plot.
3. plot3 can not accept 'color' attribute.
The following updated code works on LabVIEW 8.6.
n=500;
x=[20,4,6];
y=[10,8,90];
z=[16,2,50];
color=rand(n,3);
plot3(x, y, z, '*')
axis([min(x) max(x) min(y) max(y) min(z) max(z)])
xlabel('X');
ylabel('Y');
zlabel('Z');
view(36,18)
grid on