[Ex1 - Q3] Ajout
This commit is contained in:
parent
16d08a4592
commit
349e35266a
10
README.md
10
README.md
@ -69,3 +69,13 @@ densiteOceanie = populationOceanie / surfaceOceanie;
|
|||||||
- Asie : 140.97 habitants/km²
|
- Asie : 140.97 habitants/km²
|
||||||
- Europe : 32.28 habitants/km²
|
- Europe : 32.28 habitants/km²
|
||||||
- Océanie : 4.76 habitants/km²
|
- Océanie : 4.76 habitants/km²
|
||||||
|
|
||||||
|
## Question 3
|
||||||
|
> Représenter la densité moyenne d’habitants au km2 pour chaque continent en utilisant un diagramme en bâtons (on mettra en abscisse des entiers de 1 à 6).
|
||||||
|
|
||||||
|
**[Script Scilab](resources/scripts/ex1-3.sce) :**
|
||||||
|
```scilab
|
||||||
|
bar([densiteAfrique, densiteAmeriqueDuNord, densiteAmeriqueDuSud, densiteAsie, densiteEurope, densiteOceanie]);
|
||||||
|
```
|
||||||
|
**Résultat :**
|
||||||
|
![Diagramme en bâtons](resources/img/ex1-3.png)
|
BIN
resources/img/ex1-3.png
Normal file
BIN
resources/img/ex1-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
10
resources/scripts/ex1-3.sce
Normal file
10
resources/scripts/ex1-3.sce
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
data = csvRead("resources/data/data.csv");
|
||||||
|
|
||||||
|
densiteAfrique = sum(data(1:57, 3)* 1000000) / sum(data(1:57, 2)* 1000);
|
||||||
|
densiteAmeriqueDuNord = sum(data(58:86, 3)* 1000000) / sum(data(58:86, 2)* 1000);
|
||||||
|
densiteAmeriqueDuSud = sum(data(87:99, 3)* 1000000) / sum(data(87:99, 2)* 1000);
|
||||||
|
densiteAsie = sum(data(100:150, 3)* 1000000) / sum(data(100:150, 2)* 1000);
|
||||||
|
densiteEurope = sum(data(151:193, 3)* 1000000) / sum(data(151:193, 2)* 1000);
|
||||||
|
densiteOceanie = sum(data(194:207, 3)* 1000000) / sum(data(194:207, 2)* 1000);
|
||||||
|
|
||||||
|
bar([densiteAfrique, densiteAmeriqueDuNord, densiteAmeriqueDuSud, densiteAsie, densiteEurope, densiteOceanie]);
|
Loading…
Reference in New Issue
Block a user