Get a plot next to an existing plot
Show older comments
Hi Guys,
My Problem is, that I need to get a second plot next to an existing plot.
I thought, that I need to get Points, that are on the plotted Line and try to calculate normal vectors that show me the new points that I need.
The main Problem is, that the differences from start to end are not equal and have to be linear.
Well the new one should start at the coordinates (1 b) and end at (5 a).
n = 3;
n1 = n-1;
a = 20; % Breite des Krummers entlang x
b = 10; % Höhe des Krümmers entlang y
P = [0 b;0 0;a 0];
x = P(:,1); % x-Werte für scatter
y = P(:,2); % y-Werte für scatter
T = 21; % Anazhl an Teilpunkten für den Plot
syms t
B = bernsteinMatrix(n1,t);
bezierCurve = simplify(B*P) % simplify für undefinierte Variablen verwenden
fplot(bezierCurve(1), bezierCurve(2), [0, 1]) % [0,1] = Intervall für t
axis equal
grid on
hold on
scatter(x,y,'filled')
hold off
clear t
t = linspace(0,1);
B = bernsteinMatrix(n1,t);
bezierCurve = B*P;
px = bezierCurve(:,1);
py = bezierCurve(:,2);
pt = interparc(T,px,py,'spline') % x,y-Werte!!
x = pt(:,1);
z = pt(:,2);
plot(px,py,'r*',pt(:,1),pt(:,2),'b-o')
axis([-1.1 1.1 -1.1 1.1])
axis equal
axis tight
grid on
I hope at least somebody understands my problem and can give me a little hint.
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Annotations 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!

