Using mulitiselect in uigetfile to plot the selected files

12 ビュー (過去 30 日間)
noname
noname 2018 年 3 月 26 日
コメント済み: Von Duesenberg 2018 年 3 月 26 日
Hi everyone,
My previous question was to open the selected file and plot it. The problem gets more complicate if I want to use multiselect in uigetfile to open as many files as possible, them plot those files. I don't know how to approach the problem. Can anyone help me? Thanks alot!
  2 件のコメント
Von Duesenberg
Von Duesenberg 2018 年 3 月 26 日
I missed the earlier question, sorry.

サインインしてコメントする。

回答 (1 件)

Von Duesenberg
Von Duesenberg 2018 年 3 月 26 日
Is this useful ? :
[filename, pathname, ~] = uigetfile('*.txt', 'Select text files','MultiSelect', 'on');
if filename ~= 0
h = waitbar(0,'Loading files...');
for i=1:length(filename)
myTable = readtable([pathname filename{i}]);
figure;
plot(myTable.Var1, myTable.Var2, 'bo')
waitbar(i / length(filename))
end
close(h)
end
  2 件のコメント
noname
noname 2018 年 3 月 26 日
Do you know how to the header of each file, so the user can later select data based on header and do the comparison between different files like plot, calcualte mean, and so on?
Von Duesenberg
Von Duesenberg 2018 年 3 月 26 日
If you're referring to column headers: if you open your files with readtable, your headers will be there:
myTable.Properties.VariableNames

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by