Stream Ribbon Issues
Show older comments
Hello, I'm using the streamribbons function in my roller coaster design class. I've gotten a program to work and graph a full curve with a very small "rot" (rotation angle) but when i calculate an angle and put it in the code instead it only graphs half of the curve.
The curve values are a 198x3 double and the rotation angle is a 198x1. If anyone has experienced this before, please let me know.
% ---variables and step size---
u=-1:.01:1;
A =20; B=20; C=20;
D =10; E=0; F=10;
% ---Calculate Vertical---
vertical =[A*mfun('T',7,u)' B*mfun('T',5,u)' C*mfun('T',3,u)'];
verticaldat = [A*mfun('T',7,u)' B*mfun('T',5,u)' C*mfun('T',3,u)'];
verticaldat2 = verticaldat(1:198,:);
% ---Calculate Rotation---
Vo = 90;
rot = slopenumeric(verticaldat,Vo); % program i wrote to calculate theta
rotl = length(rot); % based upon the initial speed to
rot = {rot'}; %produce an even normal force
% --- Adjust Vertical size---
vertical1 = vertical(1:rotl,:); % changes size
vertical = {[vertical1(:,1) vertical1(:,2) vertical(:,3)]};
% ---Plot graph---
A1 =streamribbon(vertical,rot,1);
set(A1,'FaceColor','r',...
'EdgeColor',[.7 .7 .7],...
'AmbientStrength',.6)
hold on
plot3(verticaldat(:,1),verticaldat(:,2),verticaldat(:,3))
Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!