Get value from function to be used in program
Ältere Kommentare anzeigen
Hello,
I wrote a simple function program called ADD:
function A = ADD(N,M);
A = N + M
return
and this is the main program:
N = 10;
M = 30;
ADD(N,M);
sin(2*pi*A);
When I run the main program, I get the error that says "Undefined function or variable 'A' ".How do I go about making the value from the ADD function available to the main program? I have both the function and main program in the same folder.
Thanks for your help!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!