Reapeting same line with different coordinates

Hi, I have a line in matlab with X,Y,Z coordinates. I need to make for example 10 lines with same Y and Z coordinates but with changed X coordinate, where X is the same for the whole line. Is there a code for that or a way to do it?

2 comentarios

Guillaume
Guillaume el 3 de Jul. de 2018
It's very likely that there is a simple way to do it. However, your input and output description is not very clear. Can you give an example of inputs in valid matlab syntax and the desired output.
Matija Kosak
Matija Kosak el 3 de Jul. de 2018
for example I have matrix A with 3 columns and 30 rows. for example row 1 is X, row 2 is Y and row 3 is Z, and for are X-s value is 50. and for Y and Z are random numbers. I would like to make matrx B with 3 columns and 30 rows also with X,Y,Z where Y and Z stay the same, and X-s are turned from 50 to 25. Picutre shows you matrix.

Iniciar sesión para comentar.

 Respuesta aceptada

Guillaume
Guillaume el 3 de Jul. de 2018
If I understood correctly, all you need to do is
B = A;
B(:, 1) = 25;

Más respuestas (0)

Categorías

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

Etiquetas

Preguntada:

el 3 de Jul. de 2018

Respondida:

el 3 de Jul. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by