Info

此问题已关闭。 请重新打开它进行编辑或回答。

I want to connect points on my plot, how can I do it?

1 次查看(过去 30 天)
I made a plot of point. I want to connect them and make a surface (volume if possible) as one solution and for the second solution I want to connect them with lines. How Can I do that? The code is here
clear all, close all, clc;
H=1700 %Visina osobe u mm
dSG=0.129*H % Duzina ramenog dijela od torza do ramenog zgloba
dH=0.185*H % Duzina nadlaktice
dF=0.146*H % Duzina podlaktice
%PRORACUN POZICIJE TOCKE WR ZA NAJNIZE VRIJEDNOSTI RANGE-A
for fiEf=-90:20:60; % rotacija oko x ramenog zgloba - RANGE je od -10 do 170 stupnjeva
for fiA=-10:20:170
for fiR=-60:20:90
for fiF=-60:20:170
COSEF=cosd(fiEf)
SINEF=sind(fiEf)
COSA=cosd(fiA)
SINA=sind(fiA)
COSR=cosd(fiR)
SINR=sind(fiR)
COSF=cosd(fiF)
SINF=sind(fiF)
%rF=[0 dF 0]'
%Ref*rF
%rF=(0,dF,0)'
EF1=0
EF2=COSEF*dF
EF3=SINEF*dF
EF=[EF1 EF2 EF3]
%plot3(rWm(:,1),rWM(:,1),rW0(:,1));
%Rr*Ra*Rf*rH
%rH=(0,0,-dH)'
RES1=(COSF*SINA+COSA*SINF*SINR)*(-dH)
RES2=COSR*SINF*dH
RES3=(COSA*COSF-SINA*SINF*SINR)*(-dH)
RES=[RES1 RES2 RES3]
%rSG
rSG= [-dSG 0 0]
%rW=rSG+Rr*Ra*Rf*rF+Ref*rEF
rW=rSG+RES+EF
plot3(rW(1),rW(2),rW(3),'--k');
hold on;
grid on;
end
end
end
end
  1 个评论
Are Mjaavatten
Are Mjaavatten 2017-12-22
I suggest that you first collect all points in an array. Start your code with the commands:
i = 1;
In the innermost loop, skip the plot commands i and instead insert:
rW(i,:)=rSG+RES+EF;
i = i+1;
You now have collected all your points in the array rW. The command:
plot3(rW(:,1),rW(:,2),rW(:,3));grid on
will plot lines between your points. Probably not in the way you would like, but I cannot help that.
I do not speak your language, so I have no idea what you are trying to do here, but your points do not lie on a well-defined surface, so a surface plot will not make any sense. If you use only one value of fiEf, then all the points seem to lie on the surface of a sphere. For other values, the sphere is shifted somewhat.
For plotting a surface, once you figure out what you really want to plot, try this link, or this.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by