Function 'range_calculator' has already been declared within this scope.
Ältere Kommentare anzeigen
I have the following driver file named 'Program 6':
[x]=range_calculator(a,b)
and the following function file named 'range_calculator'
g=9.9;
function[x]=range_calculator(a,b)
x= ((b^2)*sin(2*a))/g;
end
and I keep getting the error message above. Should I change the file name?
Thanks,
1 Kommentar
Rik
am 29 Mär. 2020
It looks like you are trying to run a script that contains an internal function with the same name. You should not put any code before the first function definition if you intend a file to work as a function.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!