Ask for matlab equations

5 ビュー (過去 30 日間)
ABDULLAH Almutairi
ABDULLAH Almutairi 2019 年 10 月 28 日
回答済み: Udoi 2022 年 6 月 22 日
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 10 月 28 日
See input() and see inputdlg()
Steven Lord
Steven Lord 2019 年 10 月 28 日
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.

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

回答 (1 件)

Udoi
Udoi 2022 年 6 月 22 日
We can easily take the input from the user using prompt command.
After taking the input for x and y we can display the sum and difference of the two values,using basic arithmetic operators '+' and '-'
prompt="Enter the value of x";
x=input(prompt);
prompt="Enter the value of y";
y=input(prompt);
sum=x+y;
diff=x-y;
disp(sum);
disp(diff);
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial.
Folow the link (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by