フィルターのクリア

Extrapolate data after shifting plot

2 ビュー (過去 30 日間)
monkey_matlab
monkey_matlab 2016 年 2 月 19 日
回答済み: Star Strider 2016 年 2 月 19 日
Hello,
In the code provided, I have shifted plot 1 in the positive x-direction, but in doing so, I have no data now from x=1 to x = 4. Also, the x-axis values go beyond 100000.
I wanted to have an end result where my x-axis values will be the same for both plots. I attempted this in excel, where I selected a few cells for the shifted y-data then did a data fill for the shifted plot. I then copied the x-axis values from plot 1 over to the shifted plot
This is a screen shot of the excel table showing the fist 10 points:
Is it possible to have the original plot and shifted plot x-axis values be the same? Thanks for your help.
v=csvread('data_extrap.csv');
freq1 = v(:,1);
plot1 = v(:,2);
shift_freq1 = freq1*4;
semilogx(freq1,plot1);
grid on;
hold on
semilogx(shift_freq1,plot1);
legend('plot 1','shifted');
hold off

回答 (1 件)

Star Strider
Star Strider 2016 年 2 月 19 日
I don’t see what’s missing. (I don’t do any significant data processing in Excel, so I can’t comment on whatever you did in Excel.)
I would use the MATLAB interp1 function. Read the documentation on it to see how to do what you want (since I’m still not clear on that). Consider using 'linear','extrap' if you want to do extrapolation.

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by