How to write a structure variable in m file through another script?

조회 수: 12 (최근 30일)
Partha Mitra
Partha Mitra 2018년 10월 28일
댓글: Stephen23 2018년 10월 29일
How to write a structure variable in m file through another script? Eg. I want to write a structure like a.b.c in m file through script
  댓글 수: 7
madhan ravi
madhan ravi 2018년 10월 29일
Post your solution too because it’s interesting
Stephen23
Stephen23 2018년 10월 29일
"If anyone has a better solution please let me know."
Convert to functions and pass the data as input/output arguments. This is "better" in the sense that it will be faster, will not impede the JIT engine, will be easier to debug, will allow memory management to handle the variables properly, and will be easier to understand. Printing strings in files is meta-programming, which is not recommended.
Functions are what experienced users use to write neat, efficient code. You should use them too.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품


릴리스

R2010b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by