create coordination matrix from zig zag path
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Islam Hassan
el 14 de Jul. de 2020
Comentada: Islam Hassan
el 14 de Jul. de 2020
I want to creat matrix with x and y coordiantion of zig zag path.
For example :
So the generated matrix should be like this:
A = [ o o
0 410
1 410
1 0
2 0
2 410
3 410
3 0
4 0
4 410
. ... ......]
let's say the x direction limit is 8 . How can we do this ?
0 comentarios
Respuesta aceptada
David Hill
el 14 de Jul. de 2020
x=0:9;%xend odd only
y=[0;410;410;0];
A=[repelem(x',2),repmat(y,(x(end)+1)/2,1)];
6 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!