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!