Writing to text file problem
Show older comments
Hello everybody,
I need to import some basic data in a very basic form to Matlab. I am able to import the data with 'load' and 'dlmread' commands, but when using 'save' and 'dlmwrite' commands , i am getting errors.
-I have created the files manually, files to read from and to write to are different files.
-Matlab can open and read both of the files but cannot write to any of the files.
-Text files are located at the matlab folder which is under the 'Documents'
-I don't know if matlab has permission to access/change the files/folders but i think i wouldn't be able to make matlab read the files if it didn't have the access permission.
dosya = dlmread('delimite.txt' , ',' ) ;
c1 = dosya(:,1) ;
c2 = dosya(:,2) ;
dlmwrite('delimite2.txt' ,[c1 c2], ',' )
Error using dlmwrite (line 124)
Cannot open file delimite2.txt.
Error in Write_deneme (line 6)
dlmwrite('delimite2.txt' ,[c1 c2], ',' )
Data inside the text file is as follows;
12, 24
13, 46
34, 98
28, 52
I am using matlab R2015a and windows 10-64 bit. Problem is the same on my laptop and desktop. Both have the same windows and Matlab versions. But i have my friends who can run the code and write to text files without any problem.
Is there any easy solution to this problem, or alternatives that i can try? Sorry if there is any missing information.
Answers (1)
Pekkucuk
on 26 Mar 2018
Categories
Find more on Text Files 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!