How can I draw a curve based on two parameters?

3 visualizaciones (últimos 30 días)
mohammad heydari
mohammad heydari el 26 de Ag. de 2021
Comentada: mohammad heydari el 1 de Sept. de 2021
Hi,
I want to plot a "ngs(n1+n2+n3+2,:)" that is a "224*67501" matrix, versus longitudinal position(millimeter) "X" which is a "224*1" matrix, At desired time between 0 and 3 nanoseconds. Also "t" is a matrix with 1*67501 and dt=4.4e-14(step time). I try it but I encounter two pronlems. Firstly, "vectors must be the same lenghs" when I want to plot:
plot(X,ngs(n1+n2+n3+2,:))
secondly, I do not know how to draw it at a specific time between 0 and 3 nanoseconds.
Thanks in advance for your guidance!
  4 comentarios
Walter Roberson
Walter Roberson el 1 de Sept. de 2021
You said that X is 224*1 .
size(n3,2) is the number of columns in n3.
repmat(X,1,size(n3,2)) requests to replicate X (224 x 1), with the repeating to be 1 time in the first dimension (leaving it 224 x something), and size(n3,2) times in the second dimension. X is currently x 1 in the second dimension.
The effect is to take the column vector X and to repeat that column vector 67501 times, so that you get a 224 x 67501 array in which every column is the same as every other column.
mohammad heydari
mohammad heydari el 1 de Sept. de 2021
I fully understood it.
thank you very much.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by