ploting a 2D graph with multiple lines

조회 수: 6 (최근 30일)
danielle sisserman
danielle sisserman 2020년 11월 12일
댓글: Ameer Hamza 2020년 11월 16일
Hi, I'm a bigginer and what I need is too specific.
I need to plot a graph that looks exaclty like this:
I have a h vector of size 4. a matrix X of size 4x39 and a matrix f(x) of size 4x39.
each line represents the ploting of row i in matrix X with corresponding row i in matrix f(x) for h(i).
Can someone please tell me how to plot this?
Thank you

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 12일
편집: Ameer Hamza 2020년 11월 12일
Something like this
X; % 4x39
f; % 4x39
h; % 4x1
plot(X.', f.')
xlabel('x')
ylabel('(approximate) f(x)')
legend_strs = compose('Approximate f with h=%.2f', h)
legend(legend_strs)
  댓글 수: 6
danielle sisserman
danielle sisserman 2020년 11월 16일
Thank you!
Ameer Hamza
Ameer Hamza 2020년 11월 16일
I am glad to be of help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by