Azzera filtri
Azzera filtri

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

4 visualizzazioni (ultimi 30 giorni)
please write MATLAB code to find the result of equation
ı need codes and matlab script
  2 Commenti
darova
darova il 18 Giu 2020
Have you tried something? What problems are facing?
Atul Upadhyay
Atul Upadhyay il 18 Giu 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.

Accedi per commentare.

Risposta accettata

Murathan Cuya
Murathan Cuya il 19 Giu 2020
Modificato: Murathan Cuya il 21 Giu 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)

Più risposte (1)

Atul Upadhyay
Atul Upadhyay il 19 Giu 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.

Categorie

Scopri di più su Graphics Object Programming in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by