# MathWorks should have an office in my village ... !!

• Created by: Aurelien Queffurust
• Latest result: Plot created
• Created on: 04 Jun 2012
• Liked: 2 times

The idea is to compare everyday at 1:00 PM the temperature between my village Corbières (04220) in the South of France (near Marseille) and Meudon (French MathWorks Office which is near Paris)

After a few months , taking the decision to build a new office at Corbières should be easy ;-)

The information is gathered from Meteociel : http://www.meteociel.fr/previsions/1599/corbieres.htm and http://www.meteociel.fr/previsions/33209/meudon.htm. They use the American system Global Forecast System which is a global numerical weather prediction computer model.

See also : mon blog MATLAB pour les geeks!

```% Reason why MathWorks should have an office in my village
% remove nan

study_days = fix(time1724(end)-time1724(1));

%% first plot Fahrenheit (for US people)
%°F = (( 9 x °C ) / 5 ) + 32
fahreinheit_data = (9*data1724)/5+32;
y1min = min(min(fahreinheit_data));
y1max = max(max(fahreinheit_data));
subplot(2,1,1)
ylim([y1min(1)-1 y1max(1)+1])
ylabel('Temperature in Fahreinheit')
plot(time1724,fahreinheit_data(:,1),'r-','displayname','Corbières','LineWidth',2)
hold on
plot(time1724,fahreinheit_data(:,2),'b-','displayname','TMW','LineWidth',2)
datetick
ylabel('Fahreinheit')

title([int2str(study_days) ' days later : What about a TMW office in the South Of France? !'],'fontweight','bold','color','red')
set(gca,'fontweight','bold')
set(gca,'ygrid','on','tickdir','out')
legend('location','SouthWest')

%% DEGREES
subplot(2,1,2)
ylabel('Temperature in Degrees')

y1min = min(min(data1724));
y1max = max(max(data1724));

corbieres_temperatures= data1724(:,1);
paris_temperatures = data1724(:,2);

% find the number of times it was warmer in Paris
index_betteratParis = find(corbieres_temperatures<paris_temperatures);
fprintf('\n Only %d times higher in Paris: ',numel(index_betteratParis))
Paris_was= data1724(index_betteratParis,2)
corbieres_was= data1724(index_betteratParis,1)

plot(time1724,corbieres_temperatures,'r-','LineWidth',4)
hold on
plot(time1724,paris_temperatures,'b-','LineWidth',4)
ylim([y1min(1)-2 y1max(1)+2])

[biggest_ecart ,loc] = max(corbieres_temperatures-paris_temperatures);
high_temperature = max(data1724(loc,1))

was = datestr(time1724(loc),1);

% remove nan
corbieres_temperatures(isnan(corbieres_temperatures)) = [];
paris_temperatures(isnan(paris_temperatures)) = [];

mean_corb = mean(corbieres_temperatures);
mean_TMW = mean(paris_temperatures);
ylabel('Degrees')
title(['Mean Temperature : Corbieres -> ' num2str(mean_corb,3) ' °C ',...
' vs French TMW office -> ' num2str(mean_TMW,3) ' °C' 10,...
'Biggest difference : ' int2str(biggest_ecart) '°C on ' was  ' (' int2str(data1724(loc,1)) ' °C at Corbières)'])
set(gca,'ygrid','on','tickdir','out')
datetick

set(gcf,'color','yellow')```
Tags:

### 5 comments

Aurelien Queffurust 12 months ago

This plot has been quoted on the blog "MATLAB Central Release Notes – May 2012" : http://blogs.mathworks.com/community/2012/06/04/matlab-central-release-notes-may-2012/

Aurelien Queffurust 11 months ago

This Trendy was also discussed on the blog "MATLAB Spoken Here"
Multipoint data gathering in Trendy:
http://blogs.mathworks.com/community/2012/06/18/multipoint-data-gathering-in-trendy/

Aurelien Queffurust 9 months ago

If we look at the mean temperature, we can use the formula "Six degrees of separation" !!

Aurelien Queffurust 8 months ago

In 4 months (121 days), it happened only 3 times that the temperature was higher in Paris ...

Aurelien Queffurust 7 months ago

August 27th, 2012 :
This Trendy was again discussed on the blog "MATLAB Spoken Here" http://blogs.mathworks.com/community/2012/08/27/learn-about-matlab-plots-using-trendy/