how to comment on ploting data in graph?

12 visualizaciones (últimos 30 días)
Engineer Batoor khan mummand
Engineer Batoor khan mummand el 22 de Oct. de 2020
Editada: Image Analyst el 22 de Oct. de 2020
Hi all;
i want to plot these two series of data and just nominate or comment two valuse from below series of data in ploting graph.
for example i want to give comment or name to 789 as required value in graph or 500 name as critical value.
solar radiation=[456 789 999 334 556 778 456 234 545 343 300 400 500 600 345]
heat gain=[456 789 765 345 234 654 768 979 567 456 678 453 867 989 234 ]
i will be very thankful .
thanks
  2 comentarios
Ameer Hamza
Ameer Hamza el 22 de Oct. de 2020
The two vectors you have written have different lengths.
Engineer Batoor khan mummand
Engineer Batoor khan mummand el 22 de Oct. de 2020
i editted my question dear .

Iniciar sesión para comentar.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 22 de Oct. de 2020
You can do something like this
solar_radiation=[456 789 999 334 556 778 456 234 545 343 300 400 500 600 345];
heat_gain=[456 789 765 345 234 654 768 979 567 456 678 453 867 989 234];
ax = axes();
hold on
p1 = plot(solar_radiation, heat_gain);
p2 = plot(500, heat_gain(solar_radiation==500), '.', 'MarkerSize', 50, 'DisplayName', 'Required Value');
p3 = plot(789, heat_gain(solar_radiation==789), '.', 'MarkerSize', 50, 'DisplayName', 'Critical Value');
legend([p2 p3])
  2 comentarios
Engineer Batoor khan mummand
Engineer Batoor khan mummand el 22 de Oct. de 2020
thank you so much dear...
i want to import average of each day solar radiation from attached excel file but average of those solar radiation values which is greather than 200 for each day .
i will be very thankful dear.
thanks
Image Analyst
Image Analyst el 22 de Oct. de 2020
Editada: Image Analyst el 22 de Oct. de 2020
Here it is again.
[numbers, strings, rawData] = xlsread('hiii.xlsx');
daysOfWeek = strings(2:end, 2);
% Threshold at 200
goodIndexes = numbers >= 200;
% Extract only those elements above 200.
numbers = numbers(goodIndexes);
daysOfWeek = daysOfWeek(goodIndexes);
% Label each individual day.
sequentialDays = ones(length(daysOfWeek), 1);
for k = 2 : length(sequentialDays)
if ~strcmpi(daysOfWeek{k}, daysOfWeek{k-1})
% It's not the same as the prior day so we're starting a new day.
sequentialDays(k:end) = sequentialDays(k-1) + 1;
end
end
% Get the averages over any and all hours of each day.
dailyAverages = splitapply(@mean, numbers, sequentialDays);
plot(dailyAverages, 'b-', 'LineWidth', 2);
title('Daily Average of Solar Radiation', 'FontSize', 18);
xlabel('Day', 'FontSize', 18);
ylabel('Average over the Day', 'FontSize', 18);
grid on;
% Smooth the daily averages
smoothedAverages = movmean(dailyAverages, 45);
hold on;
plot(smoothedAverages, 'r-', 'LineWidth', 4);
legend('Data >= 200', 'Smoothed');
g = gcf;
g.WindowState = 'maximized';
fprintf('Done running %s.m ...\n', mfilename);

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Geodesy and Mapping en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by