在工作区我制作一个矩阵.

现在我可以在脚本中访问变量了.就像做变量(2)将返回4.
但在一个功能里面
function y= getvariable(x)
y=Variable(x)
end
Run Code Online (Sandbox Code Playgroud)
我收到错误
y=getvariable(2)
??? Undefined function or method 'Variable' for input
arguments of type 'double'.
Error in ==> getvariable at 3
y=Variable(x)
Run Code Online (Sandbox Code Playgroud)
那么如何使Variable矩阵全局化以便我可以通过任何函数访问它?
The google books api returns a volumeid for each book. This volumeid is string like this
AZ5J6B1-4BoC
UvK1Slvkz3MC
OBM3AAAAIAAJ
Run Code Online (Sandbox Code Playgroud)
So there are capital letters , small letters, characters like dash(-) underscore(_) etc
So is there a library that converts these characters to integer?
Also can I just convert the string to certain number like
[A-Z]=[0-25]
[a-z]=[26-50]
[special characters like -,_,]=[51-...]
Run Code Online (Sandbox Code Playgroud)
以上自煮脚本是否很好或者是否有某些标准功能在php中完成这项工作?