Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Hey guys, I just started using matlab. Why is this showing as the function being undefined

1 vue (au cours des 30 derniers jours)
German Bu
German Bu le 21 Mai 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021

Réponses (2)

Walter Roberson
Walter Roberson le 21 Mai 2017
Notice that at the top it still says "Untitled". You have not saved your code into my_equation.m . Also, my_equation compared to myequation matters.
  4 commentaires
German Bu
German Bu le 21 Mai 2017
I believe so, I saved it into a folder where I have saved mathlab files before

EngEdgarHS
EngEdgarHS le 21 Mai 2017
1º Try this:
function [x] = myequation(a, b, c)
top = sqrt(b-4*a);
botton = c^7;
x = (b+top)/botton;
2º Save your code in appropriated directory with same name of function (myequation.m)
3º Select folder where myequation.m is saved and try this:
x = myequation(1,2,3);
Regardles.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by