Error trying to draw a spline
1 view (last 30 days)
Show older comments
Hi,
I am trying to dray the blue line on the image below on matlab based on the geometry of the t-joint. I use coordinate iteration and spline fct to do so. I don't know why but I can't get it to work properly. Can you enlight me ?
Thanks,
clear all;
clc;
%TJoint Winding w/o radius
%The idea is to experiment with matlab
%Obtains the values
D = 'What is the diameter of the t joint? ';
D = input(D);
l1 = 'What is the length 1 of the t joint? ';
l1 = input(l1);
l2 = 'What is the length 2 of the t joint? ';
l2 = input(l2);
w = 'What is the width of the carbon fiber used? ';
w = input(w);
'Thank you, we are now processing the Filament winding of your T-Joint. Please wait ';
%Defining Graph size
x = -D/2:((D/2)+l2);
y = -l1/2 :l1/2;
z = -D/2: D/2;
%Variable Definition
r = D/2;
%Winding step one
for y=-r-l2:0.01:0;
x = (-(r+l2)/r);
z = sqrt((r.^2)-(x.^2));
xyz = [x ; y ; z];
%can be erased to remove points
hold on;
fnplt(cscvn(xyz(:,[1:end 1])),'r',2);
end
%Axis Labeling
xlabel('X Axis','FontSize',14);
ylabel('Y Axis','FontSize',14);
zlabel('Z Axis','FontSize',14);
title('Tjoint winding w/o radii','FontSize',14);
2 Comments
Answers (1)
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!