Feeds:
Posts

## Returning to Edinburgh

A profitable visit to MPE and a pleasant time in Munich behind me, I have an exciting week of idea refinement ahead. Of course it is nice to be back in Edinburgh, and the city was doing its best today to look bright in the fewer hours of daylight. One snapshot from the journey home below, reproduced from memory; the m-code is below the fold.

A reproduction of the seat cover pattern used in Easyjet aircraft, created in Matlab; the colours and number distribution of lines and squares is from memory, but I think it a good match. Of course, I can't find an image of the real thing on-line, so you'll have to compare it yourself next time you fly with them!

```clear all; close all; clc; format compact;

%% Parameters
ni = 10; % Dimension of grid
nj = 10; % /

% Colours
lcolour = [1. .3 0.];
bcolour = [.4 .4 .4];
fcolour = [.6 .6 .6];

% Dimensions
fwidth = 0.2; % Half-width of filled gray squares
lwidth = 0.22;
gwidth = 0.27;

% Fractions
ffrac = 0.4; % Probability of drawing filled square
lfrac2 = 0.4; % \
lfrac3 = 0.6; % | Probability of two, three or four orange lines
lfrac4 = 0.8; % /
gfrac = 0.6; % Residual probability of grey border

%% Loop
figure(1); hold on;

fill([0 ni+1 ni+1 0],[0 0 nj+1 nj+1],bcolour,'EdgeAlpha',0.1);
for i = 1:ni
for j = 1:nj

% Empty orange squares or lines
orand = rand;
if (orand < lfrac2)
tbflag = sign(rand-0.5); % Top or bottom line?
line([i-lwidth i+lwidth],...
[j+tbflag*lwidth j+tbflag*lwidth],...
'Color',lcolour,'LineWidth',3);

lrflag = sign(rand-0.5); % Left or right line?
line([i+lrflag*lwidth i+lrflag*lwidth],...
[j-lwidth j+lwidth],...
'Color',lcolour,'LineWidth',3);

elseif (orand < lfrac3)
tblrflag = rand; % Two horizontal or vertical lines?

if (tblrflag > .5) % Two horizontal

lrflag = sign(rand-0.5);
line([i+lrflag*lwidth i+lrflag*lwidth],...
[j-lwidth j+lwidth],...
'Color',lcolour,'LineWidth',3);

line([i-lwidth i+lwidth],...
[j-lwidth j-lwidth],...
'Color',lcolour,'LineWidth',3);

line([i-lwidth i+lwidth],...
[j+lwidth j+lwidth],...
'Color',lcolour,'LineWidth',3);

else % Two vertical

tbflag = sign(rand-0.5);
line([i-lwidth i+lwidth],...
[j+tbflag*lwidth j+tbflag*lwidth],...
'Color',lcolour,'LineWidth',3);

line([i-lwidth i-lwidth],...
[j-lwidth j+lwidth],...
'Color',lcolour,'LineWidth',3);

line([i+lwidth i+lwidth],...
[j-lwidth j+lwidth],...
'Color',lcolour,'LineWidth',3);

end

elseif (orand < lfrac4) % Four orange lines
line([i-lwidth i+lwidth i+lwidth i-lwidth i-lwidth],...
[j-lwidth j-lwidth j+lwidth j+lwidth j-lwidth],...
'Color',lcolour,'LineWidth',3);
end

% Filled gray squares
grand = rand;
if (grand < ffrac)
fill([i-fwidth i+fwidth i+fwidth i-fwidth],...
[j-fwidth j-fwidth j+fwidth j+fwidth],...
fcolour,'EdgeAlpha',0);

% Gray borders
elseif (grand < gfrac)
line([i-gwidth i+gwidth i+gwidth i-gwidth i-gwidth],...
[j-gwidth j-gwidth j+gwidth j+gwidth j-gwidth],...
'Color',fcolour,'LineWidth',3);

% Emergency grey border
elseif (orand > lfrac4)
line([i-gwidth i+gwidth i+gwidth i-gwidth i-gwidth],...
[j-gwidth j-gwidth j+gwidth j+gwidth j-gwidth],...
'Color',fcolour,'LineWidth',3);

end

end
end

axis([0.5 ni+0.5 0.5 nj+0.5]); axis square; axis off;```

### 6 Responses

1. I presume only the macroscopic properties are reproducible.

2. actually i love velvet clothe seat covers because they are very comfortable to touch .

3. I’ve learn several good stuff here. Certainly worth bookmarking for revisiting. I surprise how a lot attempt you put to create the sort of wonderful informative website.

4. Magnificent goods from you, man. I’ve understand your stuff previous to and you’re just too great. I really like what you have acquired here, certainly like what you are saying and the way in which you say it. You make it enjoyable and you still take care of to keep it wise. I can not wait to read much more from you. This is actually a great website.

5. Thanks for another magnificent article. Where else may just anybody get that kind of info in such a perfect method of writing?
I’ve a presentation subsequent week, and I am on the search for such information.

6. Excellent article. Keep posting such kind of information on your page.

Im really impressed by your blog.
Hi there, You’ve done a fantastic job. I’ll certainly digg it and for
my part suggest to my friends. I am confident they will be benefited from this site.