For Lopp data acquiring
5 ビュー (過去 30 日間)
古いコメントを表示
I want to load a data file (.dat) (No texts in the data file, only two data columns present) using load command and scatter(x,y). Now, I have a lot of data files so I need to write a loop script which assigns the variable with the filename.dat and then load it and scatter plot it repeatedly for all the .dat files present the directory.
Can you please help me since I am new to MATLAB.
0 件のコメント
採用された回答
KL
2017 年 9 月 5 日
編集済み: KL
2017 年 9 月 5 日
your_path = 'C:\Users\work\*.dat'; % your folder path
finfo = dir(your_path);
fnames = {finfo.name}';
for iCount = 1:numel(fnames)
data = dlmread(fnames{iCount});
figure
scatter(data(:,1),data(:,2));
title(fnames{iCount})
end
2 件のコメント
KL
2017 年 9 月 6 日
I don't know how exactly are you calling this Matlab script/function. One idea is to hide the display of figures and save them all in a folder of your choice. Is that what you want to do?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!