![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/383228/image.png)
how to filter imported data which is imported from excel?
2 ビュー (過去 30 日間)
古いコメントを表示
Engineer Batoor khan mummand
2020 年 10 月 16 日
コメント済み: Engineer Batoor khan mummand
2020 年 11 月 16 日
hi all:
1: i want ot import specific data from above excel file , i need to import only 01:00pm solar radiation and to unknown the formulla is given below.
2: i want to plot all T2 on fix x-axises which is 01:00PM.
3: S solar radiation given in excel file.
K=1200;
Tb=300;
Cm=4180;
m=0.5;
k*S.*(Tb-T1)=Cm*m(T2-T1)
plot(T2)
0 件のコメント
採用された回答
Image Analyst
2020 年 10 月 16 日
Not sure what T1 is, but how does this work for you?
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 22;
fprintf('Beginning to run %s.m ...\n', mfilename);
% 1: I want to import specific data from above excel file , i need to import only 01:00pm solar radiation and to unknown the formula is given below.
% 2: I want to plot all T2 on fix x-axises which is 01:00PM.
% 3: S solar radiation given in excel file.
[numbers, strings, raw] = xlsread('solardata.xlsx')
times = raw(2:end-1, 1)
solar_radiation = numbers(1:end-1); % Ignore last row which is nan.
% Convert time strings into date/time numbers
d = datevec(times);
% Find out which rows are during the 1 O'clock hour
rowsOfOneOclock = d(:, 4) == 13
% Get the solar radiation for 1 o'clock.
S1 = solar_radiation(rowsOfOneOclock)
days = strings(2:end, 2);
days = days(rowsOfOneOclock);
% Now some other math that I don't know what it means...
K=1200;
Tb=300;
Cm=4180;
m=0.5;
% k*S.*(Tb-T1)=Cm*m(T2-T1)
% Solve for T2
% k*S.*(Tb-T1) / (Cm * m) + T1 = T2
T1 = 1; % No idea -- just a guess here.
T2 = K * S1 .* (Tb - T1) / (Cm * m) + T1
plot(T2, 'b.-', 'LineWidth', 3, 'MarkerSize', 40);
grid on;
xlabel('Different Days', 'FontSize', 20);
ylabel('T2', 'FontSize', 20);
title('T2 = K * S1 .* (Tb - T1) / (Cm * m) + T1', 'FontSize', 20);
fprintf('Done Running %s.m ...\n', mfilename);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/383228/image.png)
21 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import and Analysis についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!