フィルターのクリア

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'

採用された回答

John D'Errico
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])
Fred and Ethel
Next, do you know how to convert a numeric variable into a string?
X = pi/2;
disp(['X has value ',num2str(X)])
X has value 1.5708
  6 件のコメント
John D'Errico
John D'Errico 2021 年 12 月 19 日
disp works fine. Or you can use fprintf. You might add a space aroun the 'and'.
Asli
Asli 2021 年 12 月 19 日
now is perfect..thank you so much

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by