Hi,
I have several matrices that I am trying to graph on the same plot, except that some of the matrices contain lots of NaN values, so when I plot these matrices they appear as dots (or as a marker if I set it). Is there a way to force matlab to drawn lines between the existing points, without having to recreate the matrices such that no NaN values exist?
Thank you

댓글 수: 1

FSh
FSh 2021년 4월 14일
편집: FSh 2021년 4월 14일
You can use fillmissing function but then start your line from the first not NAN value.
create_new_var= fillmissing(your_array_with_nan,'linear');% to interpolate for the NAN and create a line
fid_first_notNAN = find(~isnan(backscatter_db_corrected40), 1);
plot(x, create_new_var(id_first_notNAN:end));

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

 채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 9일

1 개 추천

No there is not. nan and infinities always mean a break in drawing the line.

추가 답변 (0개)

카테고리

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

태그

질문:

2012년 3월 9일

편집:

FSh
2021년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by