Sizing vector for plotting

1 ビュー (過去 30 日間)
shobhit mehrotra
shobhit mehrotra 2014 年 7 月 17 日
コメント済み: shobhit mehrotra 2014 年 7 月 17 日
I have a question regarding sizing vectors. I have two vectors of different size.
A = [29.44 29.45 29.47 29.49 29.46 29.47 29. 48 ....} 1x13000 vector (latitudes )
B = [ 1.34 1.36 1.37 1.39 1.38 1.41 1.42 1.40 ...} 1x91000 vector (methane)
I want vector A to be the same size as vector B so I can plot them. I want to interpolate between the values of A, for example
A = [29.44 29.442 29.444 29.446 29.448 29.45 ....]
Thanks!

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 7 月 17 日
A = [29.44 29.45 29.47 29.49 29.46 29.47 ]
B = [ 1.34 1.36 1.37 1.39 1.38 1.41 1.42 1.40 ]
na=numel(A)
nb=numel(B)
ta=1:na
tai=linspace(1,na,nb)
Ai=interp1(ta,A,tai)
plot(B,Ai)
  1 件のコメント
shobhit mehrotra
shobhit mehrotra 2014 年 7 月 17 日
Worked Thank You!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Find more on Interpolation in Help Center and File Exchange

製品

Community Treasure Hunt

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

Start Hunting!

Translated by