Write a MATLAB script (maksimin) that calculates the maximum and minimum values in an input vector. You should consider that the input vector can have any length
조회 수: 1 (최근 30일)
이전 댓글 표시
Write a MATLAB script (maksimin) that calculates the maximum and minimum values in an input vector. You should consider that the input vector can have any length. Please write the answer within a sentence.
i couldnt know how i can create a script which answer should give a sentences like that 'The maximum value is a and the minimum value is b'
댓글 수: 0
채택된 답변
John D'Errico
2021년 12월 18일
Do you know how to work with character strings, how to build them from components? You should. TRY IT! For example,
A = 'Fred';
B = 'Ethel';
disp([A,' and ',B])
Next, do you know how to convert a numeric variable into a string?
X = pi/2;
disp(['X has value ',num2str(X)])
댓글 수: 6
John D'Errico
2021년 12월 19일
disp works fine. Or you can use fprintf. You might add a space aroun the 'and'.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 String Parsing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!