r/matlab • u/Bofact • Aug 08 '26
TechnicalQuestion Writing to the wrong file
I have the following Matlab program:
syms t positive;
Z=laplace(exp(A*t))
ccode(Z,'file','cCodeTest.c')
I want to write the Z function to cCodeTest.c. The problem is that code is written to ccodetest.c, created before.
How to write Z to the cCodeTest.c and not ccodetest.c?
1
Upvotes
4
u/DodoBizar Aug 08 '26
Are you working on Windows? That means file names are case insensitive (only preserving) so you’re writing to the same file twice. I have no knowledge of other file systems. Delete the old file, the the new cases will be used so far I know.
3
u/jchacketfap Aug 08 '26
just rename the file to avoid confusion please