easy math question for you but ı dont know to solve it.

2 次查看(过去 30 天)
please write MATLAB code to find the result of equation
ı need codes and matlab script
  2 个评论
Atul Upadhyay
Atul Upadhyay 2020-6-18
To solve this problem efficiently you can use abs(x) function available in MATLAB.
So, the code is
y=abs(x);
You can refer to the following documentation for more details.

请先登录,再进行评论。

采纳的回答

Murathan Cuya
Murathan Cuya 2020-6-19
编辑:Murathan Cuya 2020-6-21
% Murathan CUYA
% 180401034 Aerospace engineering grade 1
clear
clc
x=input('tell me the number and ı will say you the answer :)type here=');
if(x<0)
y=-1*x;
else
y=x;
end
fprintf('the answer for the number that you typed is:')
disp(y)

更多回答(1 个)

Atul Upadhyay
Atul Upadhyay 2020-6-19
To solve this problem efficiently you can use abs(x) function available in MATLAB.
So, the code is
y=abs(x);
You can refer to the following documentation for more details.

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by