Effacer les filtres
Effacer les filtres

I'm using Matlab 7.0. How can I call a function? "File/New/Function" is missing.

2 vues (au cours des 30 derniers jours)
Or should I write an .m file instead beginning with:
function F = magic(x)
...
end
?

Réponse acceptée

Stalin Samuel
Stalin Samuel le 25 Oct 2014
you need to create a .m file .And the file name must same as the function name

Plus de réponses (3)

Zoltán Csáti
Zoltán Csáti le 25 Oct 2014
The syntax of writing a function is what you have written. When you want to call it, do
out = magic(in)
Be careful though, magic is a function that already exists.

Zoltán Csáti
Zoltán Csáti le 25 Oct 2014
Not a problem. It is just a help for you so that MATLAB creates a sample in advance. I never use this feature because it is not cumbersome to type function.

Übel
Übel le 25 Oct 2014
Okay, thank you. Is it a problem that the "File/New/Function" label is missing in my version?

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by