MATLAB: How define a variable like pi in matlab

constpi

I want to define several variables like pi,maybe we can call them the constant value, and call them in the functions without defining the twice time. I can not use the global variable because there are almost 100 function files in our project and I do not want to declare them in every function files, it's too troublesome.
I've tried to write the variable in the matlabrc.m, but I can only call the variable in the command window and when I call it in the function file, the matlab told me that it's an undefined variable.
So please tell me how to solve this problem, it's really appreciated of you.
I'm looking forward to your answer.

Best Answer

create a function
function out=cst1
out=0.12453648
then call the function cst1
a=cst1