How can I draw a curve based on two parameters?
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Walter Roberson
2021 年 9 月 1 日
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.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!