MATLAB Matlab: String variables to fopen()

AI Thread Summary
The discussion centers on the use of the fopen() function in programming, specifically regarding passing a file path as a string variable. Initially, there was confusion about whether fopen() accepts string variables directly. The solution presented clarifies that using the char() function can convert the string variable into a character array, which is compatible with fopen(). This allows for the creation of multiple files by storing paths in a cell array and passing them to fopen() after conversion.
Eren10
Messages
17
Reaction score
0
HI

can't I pass the path of a file as a string variable to fopen() , like this:

path = 'aadada'

fopen(path)

I want to do create many files, the paths have a logic, so I can put them in cell array and than I want to pass them to fopen() , but fopen doesn't accept a string variable, this is strange.
 
Physics news on Phys.org
problem solved, just use char() to make characters of path
 
Back
Top