How to I referrence a value (matrix) from script file to a function file
显示 更早的评论
I have a function file that has a subroutine.
When I run the subroutine I want to then reference a value from the script file when running the function file.
eg.
val = 5 (in script file)
that script file runs the function file
said function file then references val from the script file.
1 个评论
Azzi Abdelmalek
2015-7-30
What is your problem? what [reference val from script] means?
采纳的回答
更多回答(1 个)
Milad Abdollahi
2015-7-30
You can define your variable in script file by global and the recall it in you function again by global here is an example:
%define global variable in script file
global val
val=5;
use val in function like this
%recall global variable
global val
y=3*val^2+1;
类别
在 帮助中心 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!