MATLAB: Way to plot multiple lines in 3d specifying start and end point 3d plotslineMATLABplot Is there a way to plot multiple lines on 3 axis and specify the start and end point This is a crude example but something like Line Start (x,y,z) Line To (x,y,z) Best Answer P0 = rand(7,3) ;P1 = rand(7,3) ;X = [P0(:,1) P1(:,1)] ;Y = [P0(:,2) P1(:,2)] ;Z = [P0(:,3) P1(:,3)] ;plot3(X',Y',Z')hold onplot3(X',Y',Z','.') Related SolutionsMATLAB: Plot to a central point n = length(xcoords); px(1:2:2*n-1) = xcoords; px(2:2:2*n-2); = xcenter; py(1:2:2*n-1) = ycoords; py(2:2:2*n-2); = ycenter; plot(px,py,'y-') MATLAB: How to determine each local min point If you have the Image Processing Toolbox, you can use imregionalmin(), like this:% Original codex = 0: 0.00001: 4;v = x.*exp(x/2);t = sin(v);plot(x,t);% Image Analyst's code:minsIndexes = imregionalmin(t); % Logical array of where mins are.% Extract the t values at those min locations;minValues = t(minsIndexes) % Get the x values at those mins.minX = x(minsIndexes) % Plot star over the mins.hold on;plot(minX, minValues, 'r*', 'MarkerSize', 10);In the command window:minValues = 0 -1.00 -1.00 -1.00 -1.00 -0.96minX = 0 1.86 2.76 3.31 3.70 4.00 Related QuestionPlotting a 3D graph, incorrect solution.Parallel patternsearch influenced by starting pointHow to set custom origin point
Best Answer