how to display two value in each row of one message box?

조회 수: 1 (최근 30일)
son
son 2014년 8월 23일
댓글: Star Strider 2014년 8월 23일
hi, please hlep
x = [0 3 4 5 7 9 10 2 3 5];
y = 4:1:14;
z = 5 * x
find all the z that 10 < z < 0.7*max(z) and display the value of z and corresponding y in one message box for example:
the value of z = 20 at y = 6
the value of z = 25 at y = 7
the value of z = 35 at y = 8
the value of z = 15 at y = 13
the value of z = 25 at y = 14

채택된 답변

Star Strider
Star Strider 2014년 8월 23일
편집: Star Strider 2014년 8월 23일
This works:
x = [0 3 4 5 7 9 10 2 3 5];
y = 4:1:13;
z = 5 * x;
ix = find((z < 0.7*max(z)) & (z > 10));
msgbox(sprintf('The value of z = %d at y = %d\n', [z(ix)' y(ix)']'))
Sorry, missed that on the the first read. Changed y as well.
  댓글 수: 3
son
son 2014년 8월 23일
i found it. many thanks
Star Strider
Star Strider 2014년 8월 23일
My pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by