how to filter imported data which is imported from excel?

4 次查看(过去 30 天)
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)

采纳的回答

Image Analyst
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);
  21 个评论
Engineer Batoor khan mummand
Hi image Analyst ... I hope you will be fine and doing well. Yes I have used splitapply() but as u know each month length is not equal I mean we have some months 30 days and some of months of 31 days so this is creating problem in matlab. Thanks dear

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by