What is input?

13 ビュー (過去 30 日間)
Bryon
Bryon 2022 年 12 月 16 日
回答済み: Santosh Fatale 2022 年 12 月 19 日
Which of the following(s) is/are TRUE about "input" command?
-Input can be numeric or a character
-Assign a data to a variable name.
-Solicit an input from a user.
-Input can be a vector
  1 件のコメント
KSSV
KSSV 2022 年 12 月 16 日
Read it here: input

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

回答 (1 件)

Santosh Fatale
Santosh Fatale 2022 年 12 月 19 日
Hi Bryon,
All the statements are true for the "input" function. For more information about the "input" function, please refer to the documentation link.
Here are a few examples that might help you.
>> variable1 = input("Enter Input:") % Entered input matrix is assigned to variable1.
Enter Input:[1 2; 3 4]
variable1 =
1 2
3 4
>> variable1 = input("Enter Input:") % After semi-colon pressed “Enter”. Input is vector.
Enter Input:[1 2;] [AD1]
variable1 =
1 2
>> a = input("Enter Input:") % After semi-colon, use “Shift+Enter” to make entry for new row.
Enter Input:[1 2;
3 4;
5 6]
variable1 =
1 2
3 4
5 6
>> variable1 = input("Enter Input:") % Entered input string is assigned to variable1.
Enter Input:"String 1"
variable1 =
"String 1"

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by