Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
Murathan Cuya
Murathan Cuya le 18 Juin 2020
Modifié(e) : Murathan Cuya le 21 Juin 2020
please write MATLAB code to find the result of equation
ı need codes and matlab script
  2 commentaires
darova
darova le 18 Juin 2020
Have you tried something? What problems are facing?
Atul Upadhyay
Atul Upadhyay le 18 Juin 2020
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.

Connectez-vous pour commenter.

Réponse acceptée

Murathan Cuya
Murathan Cuya le 19 Juin 2020
Modifié(e) : Murathan Cuya le 21 Juin 2020
% 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)

Plus de réponses (1)

Atul Upadhyay
Atul Upadhyay le 19 Juin 2020
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.

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by