Multiple Challenges in Octaves

I work in an octave, I need to call plot3 two or more times to create one plot. But it only displays the last call to plot3 . I need help.

This is my code: It only displays the line plot3(tras(1), tras(2), tras(3), 'bo');

  p = [ 0.0, 0.0, 0.0 500.0, 0.0, 0.0 500.0, -500.0, 0.0 0.0, -500.0, 0.0 0.0, 0.0, 0.0]; mano = [119.818542 -43.371277 50.230591 1]; Tinv = [ 0.998891 -0.001007 0.047065 64.223625 0.000000 0.999771 0.021382 -291.750854 -0.047076 -0.021359 0.998663 -1871.334229 0.000000 0.000000 0.000000 1.000000 ] tras = Tinv*mano' hold("on"); xlabel("X"); ylabel("Y"); zlabel("Z"); plot3(p(:,1), p(:,2), p(:,3), 'r*-'); plot3(tras(1), tras(2), tras(3), 'bo'); hold("off"); pause; 
+6
source share
1 answer

Your build code is fine. Try making the plot size larger with the axis function. Next change:

 % ... % Usage of axis: axis([xmin xmax ymin ymax zmin zmax]) axis([-100 600 -600 100 -2100 100]); plot3(p(:,1), p(:,2), p(:,3), 'r*-'); plot3(tras(1), tras(2), tras(3), 'bo'); % ... 

The results in the following graph: enter image description here

Ideally, you do extents in axis with respect to the minimum and maximum coordinate values ​​in p and tras .

+5
source

Source: https://habr.com/ru/post/903806/


All Articles