How to convert this equation to code?

3 vues (au cours des 30 derniers jours)
Bruh
Bruh le 9 Juil 2022
Commenté : Bruh le 9 Juil 2022
I think it is x*sqrt((16-x**2)**3)) but it didnt wort

Réponses (3)

Alan Stevens
Alan Stevens le 9 Juil 2022
Use ^ not **

Chandrika
Chandrika le 9 Juil 2022
As per my understanding, you want the MATLAB code for the given expression. Please try using the following code for the same:
y=x*sqrt(cube((16-sqr(x))))
function square=sqr(x)
square=x*x;
end
function cuben=cube(x)
cuben=x*x*x;
end
You can check the above script by computing 'y' for different values of x.
Hope this helps!

Sam Chak
Sam Chak le 9 Juil 2022
Hi Bruh, First, it's because you used the Python code. Second, bracket issue. Try this instead:
x.*sqrt((16 - x.^2).^3)
  1 commentaire
Bruh
Bruh le 9 Juil 2022
How about convert the formula to phyton code?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Call Python from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by