plot 2 vectors not same length

Hi all,
i would like to plot 2 vecotrs not the same length ( velocity with 412 elements and time with 380169 elements), i tried this with the "griddedInterpolant command" but it doesnt work. I want that time-vector to have the same lenght as velocity-vector if that possbile. I will appreciate any help

댓글 수: 4

griddedInterpolant works fine if you use it correctly, but you didn't show any code. Just saying 'it doesn't work' without saying why or showing what you tried is no use to anyone.
doc interp1
should work fine though anyway in this case.
Also, if you want people to answer your question try putting some useful tags. They are there for your sake so at least take the time to put something intelligent rather than '1'.
Alex
Alex 2017년 2월 20일
편집: Alex 2017년 2월 20일
Hi Adam,
thank you for ur advice, i will keep it in my mind for the next questions. i tried this code bellow:
%zeit_est = time
F = griddedInterpolant (412, zeit_est)
Im trying basically to to minimize the elements of vector time to 412.
but i keep getting this error
Error using griddedInterpolant Interpolation requires at least two sample points in each dimension.
the cyclist
the cyclist 2017년 2월 20일
The code you posted shows that you don't understand even basic MATLAB syntax. I recommend that you go through some of the many freely available online tutorials. This page is a good starting point.
dpb
dpb 2017년 2월 20일
"...[interpolate to] same length ( velocity with 412 elements and time with 380169 elements)"
Besides the other comments, you'll need the time corresponding to the velocity elements. Without, there's no way to know which to place where along the axis. One could assume (altho that's all it would be) that they're linearly-spaced with the first at point 1 and the last at the end of the time vector and just use the ordinal values but we have no way to know about that.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Numeric Types에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2017년 2월 20일

댓글:

dpb
2017년 2월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by