About sub function............
Afficher commentaires plus anciens
How ı can write a function and sub function.
Can you give me an example ?
Réponses (2)
David Hill
le 6 Juin 2020
function out=showMe(in)
n=1;
out=executeSub();
function o=executeSub()%I assume you are talking about a nested function
o=5*n;
end
end
Look at matlab help: Nested Functions
David Hill
le 6 Juin 2020
function Soru6
aci=input('Lütfen açıyı giriniz : ');
F=input('Lütfen kuvveti giriniz : ');
mesnet
function mesnet
y=aci*F
fprintf('%g',y);
end
end
Works just fine but you still need to execute it.
Soru6;
4 commentaires
Emre Tutucu
le 6 Juin 2020
madhan ravi
le 6 Juin 2020
You need to save it as a separate file in the name Soru6.m
Emre Tutucu
le 6 Juin 2020
Image Analyst
le 6 Juin 2020
Then attach all needed files so we can run them ourselves.
Catégories
En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!