开发者

.dat file how to create one based on excel document

开发者 https://www.devze.com 2023-04-12 04:04 出处:网络
I have a .csv file in my matlab folder with 38 columns and about 48 thousand entries. I was hoping on using the findcluster gui but it only accepts .dat files.

I have a .csv file in my matlab folder with 38 columns and about 48 thousand entries. I was hoping on using the findcluster gui but it only accepts .dat files.

How do I create a .dat开发者_JS百科 file in matlab or specifically how do I convert the .csv file into a .dat file that can be used by the matlab fcm clustering tool?

example of csv:

.dat file how to create one based on excel document

how would I go about creating a data file for this kind of information?


The only documentation I could find about the file format was

The data set must have the extension .dat. For example, to load the data set, clusterdemo.dat, type findcluster('clusterdemo.dat').

I checked clusterdemo.dat and found that the data is stored in ASCII format. Therefore, try

a = csvread('data.csv');
save 'data.dat' a -ASCII


Just rename xxx.csv to xxx.dat. This worked for me.


you should try changing extension.For changing extension you can go to folder settingand in view where we show hidden file…uncheck the hide extension for known files and now you can change the extension of any file by renaming it.

Because There really isn't such a thing as 'dat' format, a 'dat' file is just a text file, it could theoretically have any extension you want.It could also be delimited however you want/need, it all really depends on what you are trying to achieve.

ie what are you going to use this file for? If it's for use with another application then the requirements of that application will probably dictate how it's delimited/structured etc.

OR simply you can save the file from the excel as .csv and then later can change the extension.

It worked for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号