2
$\begingroup$

I want to save a matlab source code into a string format in matlab. Does anyone know how to do this? For example,

type xxx.m

can display the source code of xxx.m. Then using what command am I able to save it into a string?

$\endgroup$
2
$\begingroup$

Use string =type('filename.m'); as per the MATLAB documentation page for the type command.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.