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

조회 수: 2 (최근 30일)
Murathan Cuya
Murathan Cuya 2020년 6월 18일
편집: Murathan Cuya 2020년 6월 21일
please write MATLAB code to find the result of equation
ı need codes and matlab script
  댓글 수: 2
darova
darova 2020년 6월 18일
Have you tried something? What problems are facing?
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