Filter löschen
Filter löschen

How can I draw a curve based on two parameters?

1 Ansicht (letzte 30 Tage)
mohammad heydari
mohammad heydari am 26 Aug. 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 Kommentare
Walter Roberson
Walter Roberson am 1 Sep. 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 am 1 Sep. 2021
I fully understood it.
thank you very much.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by