I want to convert a string to .m file
Show older comments
ex: (for understand what I mean clearly)
if I have a string stored in some variable
let's say y="x=sin(pi)";
I want matlab to create a .m file with a certain name a save that string in it
so, the string will be a command line in that .m file

4 Comments
stozaki
on 2 Feb 2020
Do you mean you want to execute the string "x = sin (pi)" and get x = 1.2246e-16?
Sridhar SG
on 2 Feb 2020
Are you asking how to create an userdefined function?
Osama Alkurdi
on 2 Feb 2020
Osama Alkurdi
on 2 Feb 2020
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!