How to combine multiple functions/lines/arcs in only one?

I have drawn the following arc (drawn in pink)
Using and putting one next to another the following arcs (each one with different xp,yp,radius and centre values of course)
teta = linspace(rangini,rangfin);
xco = centre(1)+radius*cos(teta);
yco = centre(2)+radius*sin(teta);
plot(xco,yco,'m');
There is any form of uniting those arcs in only one function so I could work with it more easily in further code/programm?

4 comentarios

If you have two set of points (x1, y1) and (x2, y2)..you can join them by
P = [x1 y1; x2 y2]
I am assuming that the data are column vectors.
In any case it would be P=[x1 x2;y1 y2], no?
In nay case, I made that and It doesn't work
KSSV
KSSV el 2 de Nov. de 2020
Why not what error you got?
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras el 2 de Nov. de 2020
Editada: ErikJon Pérez Mardaras el 2 de Nov. de 2020
It draws me a strange figure that has nothing to do with what I want. I have find the solution, however, a lot of thanks for your repply!

Iniciar sesión para comentar.

 Respuesta aceptada

ErikJon Pérez Mardaras
ErikJon Pérez Mardaras el 2 de Nov. de 2020
The solution in making a matrix like that
arc=[x1 x2 x3 x4 x5 x(n)... ;y1 y2 y3 y4 y5 y(n)...]
Important putting the first coordinates first

Más respuestas (0)

Categorías

Más información sobre Polar Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by