How to match an excel cell with a data file to create a plot
2 ビュー (過去 30 日間)
古いコメントを表示
for i=1:1:50
%randomizing the value of a between 1 to 7092
a=randi([1,7092]);
%making the name of the R random
name=['R',num2str(a),'.txt'];
%importing that randomized R text file
data=importdata(name);
%making the matrix into a vector
acceleration=data(:);
acceleration(i);
%reading excel file
excelfile = xlsread('Final_NGA_Flatfile.xlsx');
%extracting dt from excel files
dt=excelfile(:,4);
%putting ft matrix into one vector
dtnewnew=dt(:);
for n=1:size(dt)
xvalues=dt;
xvaluesnew=xvalues(:);
xvaluesnewnew=xvaluesnew*(n-1);
end
%PLOT/LABEL
plot(xvaluesnewnew,'DisplayName','xvaluesnewnew');
hold on;
plot(acceleration,'DisplayName','acceleration');
hold off;
xlabel('time');
ylabel('acceleration');
title('Earthquake Data (acceleration vs. time)');
end
I am trying to match an excel cell with data from a text file to create a plot. I want to do this with 50 excel cells, so i think i should use a loop, but i am not sure. I cannot upload the excel file and data files because there are 7000 data files.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!