how to filter imported data which is imported from excel?

4 views (last 30 days)
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)

Accepted Answer

Image Analyst
Image Analyst on 16 Oct 2020
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 Comments
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

Sign in to comment.

More Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!