Skip to content

Commit 35d875e

Browse files
committed
final version
1 parent 19bc6c5 commit 35d875e

33 files changed

+47
-110
lines changed

evalMD.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
fileList = dir('matlab/*.md');
99

1010
% Loop over all files
11-
for i = 1 :length(fileList)
11+
for i = 44%1 :length(fileList)
1212
fileName = fullfile(fileList(i).folder,fileList(i).name);
1313
fprintf('Evaluating (%03d): %s\n',i,['matlab/',fileList(i).name]);
1414
mdContents = readlines(fileName,'Encoding','UTF-8');

matlab/2021-08-04-3D-histogram.md

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ page_type: u-guide
1414

1515
Generate 10,000 pairs of random numbers and create a bivariate histogram. The `histogram2` function automatically chooses an appropriate number of bins to cover the range of values in `x` and `y` and show the shape of the underlying distribution.
1616

17-
```{matlab}
18-
x = randn(10000,1);
19-
y = randn(10000,1);
20-
h = histogram2(x,y);
21-
22-
fig2plotly(gcf);
23-
```
24-
25-
2617

2718
```{matlab}
2819
x = randn(10000,1);
@@ -32,22 +23,21 @@ h = histogram2(x,y);
3223
xlabel('x');
3324
ylabel('y');
3425
26+
nXnY = h.NumBins
27+
3528
fig2plotly(gcf);
3629
```
3730

38-
3931
When you specify an output argument to the `histogram2` function, it returns a histogram2 object. You can use this object to inspect the properties of the histogram, such as the number of bins or the width of the bins.
4032

41-
Find the number of histogram bins in each dimension.
33+
Find the number of histogram bins in each dimension using `h.NumBins`.
34+
4235

4336
```{matlab}
4437
x = randn(10000,1);
4538
y = randn(10000,1);
4639
h = histogram2(x,y);
4740
48-
xlabel('x');
49-
ylabel('y');
50-
5141
nXnY = h.NumBins
5242
```
5343

@@ -77,9 +67,7 @@ y = randn(1000,1);
7767
nbins = 5;
7868
h = histogram2(x,y,nbins);
7969
80-
counts = h.Values;
81-
82-
fig2plotly(gcf);
70+
counts = h.Values
8371
```
8472

8573

@@ -92,9 +80,6 @@ Generate 1,000 pairs of random numbers and create a bivariate histogram.
9280
```{matlab}
9381
x = randn(1000,1);
9482
y = randn(1000,1);
95-
h = histogram2(x,y);
96-
97-
fig2plotly(gcf);
9883
```
9984

10085
Use the `morebins` function to coarsely adjust the number of bins in the x dimension.
@@ -104,7 +89,6 @@ x = randn(1000,1);
10489
y = randn(1000,1);
10590
h = histogram2(x,y);
10691
107-
nbins = morebins(h,'x');
10892
nbins = morebins(h,'x');
10993
11094
fig2plotly(gcf);
@@ -118,10 +102,6 @@ x = randn(1000,1);
118102
y = randn(1000,1);
119103
h = histogram2(x,y);
120104
121-
nbins = morebins(h,'x');
122-
nbins = morebins(h,'x');
123-
124-
nbins = fewerbins(h,'y');
125105
nbins = fewerbins(h,'y');
126106
127107
fig2plotly(gcf);
@@ -224,8 +204,6 @@ y = randn(1000,1);
224204
h = histogram2(x,y,'Normalization','probability');
225205
226206
S = sum(h.Values(:))
227-
228-
fig2plotly(gcf);
229207
```
230208

231209

matlab/2021-08-04-3d-bubble-charts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: 3d-bubble-charts.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Plot Random Bubbles

matlab/2021-08-04-3d-horizontal-bar-plots.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ page_type: u-guide
1414

1515
Load the data set `count.dat`, which returns a three-column matrix, `count`. Store `Y` as the first ten rows of `count`.
1616

17-
```{matlab}
18-
load count.dat
19-
Y = count(1:10,:);
20-
```
21-
2217
Create a 3-D horizontal bar graph of `Y`. By default, the style is `detached`.
2318

2419
```{matlab}
@@ -38,11 +33,6 @@ fig2plotly(gcf, 'TreatAs', 'bar3h');
3833

3934
Load the data set `count.dat`, which returns a three-column matrix, `count`. Store `Y` as the first ten rows of `count`.
4035

41-
```{matlab}
42-
load count.dat;
43-
Y = count(1:10,:);
44-
```
45-
4636
Create a 3-D horizontal bar graph of `Y` and set the bar width to 0.5.
4737

4838
```{matlab}
@@ -64,11 +54,6 @@ fig2plotly(gcf, 'TreatAs', 'bar3h');
6454

6555
Load the data set `count.dat`, which returns a three-column matrix, `count`. Store `Y` as the first ten rows of `count`.
6656

67-
```{matlab}
68-
load count.dat
69-
Y = count(1:10,:);
70-
```
71-
7257
Create a 3-D horizontal bar graph of Y and specify the style option as `grouped`.
7358

7459
```{matlab}
@@ -89,11 +74,6 @@ fig2plotly(gcf, 'TreatAs', 'bar3h');
8974

9075
Load the data set `count.dat`, which returns a three-column matrix, `count`. Store `Y` as the first ten rows of `count`.
9176

92-
```{matlab}
93-
load count.dat
94-
Y = count(1:10,:);
95-
```
96-
9777
Create a 3-D horizontal bar graph of Y and specify the style option as `stacked`.
9878

9979
```{matlab}

matlab/2021-08-04-3d-mesh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ s = mesh(X,Y,Z,'FaceAlpha','0.5')
8282
8383
s.FaceColor = 'flat';
8484
85-
fig2plotly(gcf, 'TreatAs', 'mesh')
85+
fig2plotly(gcf, 'TreatAs', 'mesh');
8686
```
8787

8888

matlab/2021-08-04-3d-stem-plots.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ To specify only two of the three `LineSpec` options, omit the third option from
138138

139139

140140

141-
<!--------------------- EXAMPLE BREAK ------------------------->
142-
143-
## Line Style, Marker Symbol, and Color Options
144-
145141
Create a 3-D stem plot and specify the stem locations along a circle. Set the stem to a dotted line style, the marker symbols to stars, and the color to magenta.
146142

147143
```{matlab}

matlab/2021-08-04-3d-streamline-plots.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: 3d-streamline-plots.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Create 3-D Quiver Plot
@@ -224,26 +225,14 @@ fig2plotly(gcf);
224225
```
225226

226227

227-
<!--------------------- EXAMPLE BREAK ------------------------->
228-
229-
## Indicate Flow Using Precalculated Data
230-
231-
Use precalculated vertex data, curl average velocity, and speed to indicate flow.
228+
You can also use precalculated vertex data, curl average velocity, and speed to indicate flow.
232229

233230
```{matlab}
234231
load wind
235232
[sx,sy,sz] = meshgrid(80,20:10:50,0:5:15);
236233
verts = stream3(x,y,z,u,v,w,sx,sy,sz);
237234
cav = curl(x,y,z,u,v,w);
238235
spd = sqrt(u.^2 + v.^2 + w.^2).*.1;
239-
streamribbon(verts,x,y,z,cav,spd);
240-
axis tight
241-
shading interp
242-
view(3);
243-
camlight;
244-
lighting gouraud
245-
246-
fig2plotly(gcf);
247236
```
248237

249238
Using precalculated data enables you to use values other than those calculated from the single data source. In this case, the speed is reduced by a factor of 10 compared to the previous example.

matlab/2021-08-04-3d-subplots.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description: How to make 3D Subplots in MATLAB<sup>&reg;</sup> with Plotly.
33
name: 3D Subplots
4-
display_as: 3d_charts
5-
order: 4
4+
display_as: multiple_axes
5+
order: 3
66
permalink: matlab/3d-subplots/
77
thumnail_github: 3d-subplots.png
88
layout: base

matlab/2021-08-04-bubble-charts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: bubble-charts.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Plot Random Bubbles

matlab/2021-08-04-bubblecloud.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: bubblecloud.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Create Bubble Cloud with Table Data

matlab/2021-08-04-candlestick-charts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: candlestick-charts.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Generate a Candlestick Chart for a Data Series for a Stock

matlab/2021-08-04-cone-plot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ lighting gouraud;
172172
set(hsurfaces,'AmbientStrength',0.6);
173173
hcone.DiffuseStrength = 0.8;
174174
175-
fig2plotly(gcf, 'TreatAs', 'coneplot')
175+
fig2plotly(gcf, 'TreatAs', 'coneplot');
176176
```
177177

178178

@@ -220,7 +220,7 @@ hcone.DiffuseStrength = 0.8;
220220
view(30,40)
221221
daspect([2,2,1])
222222
223-
fig2plotly(gcf, 'TreatAs', 'coneplot')
223+
fig2plotly(gcf, 'TreatAs', 'coneplot');
224224
```
225225

226226

matlab/2021-08-04-continuous-error-bars.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ language: matlab
1010
page_type: u-guide
1111
---
1212

13-
To make this plot, you'll need the the boundedline package<br>
14-
from the MATLAB<sup>&reg;</sup> <a href="https://uk.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m">File exchange</a>
13+
To make this plot, you'll need the the boundedline package from the MATLAB<sup>&reg;</sup> <a href="https://uk.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m">File exchange</a>
1514

1615
## Plotting lines using various syntax options
1716

matlab/2021-08-04-feather-plot.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: feather-plot.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Create Compass Plot Using Cartesian Coordinates

matlab/2021-08-04-gauge-charts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: gauge-charts.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Create Circular Gauge

matlab/2021-08-04-group-by.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Plot mean acceleration, grouped by `Cylinders`, with 95% confidence intervals.
243243
```{matlab}
244244
load('carsmall')
245245
246-
grpstats(Acceleration,Cylinders,0.05)
246+
grpstats(Acceleration,Cylinders,0.05);
247247
248248
fig2plotly(gcf);
249249
```
@@ -256,7 +256,7 @@ Plot mean acceleration and weight, grouped by `Cylinders`, and 95% confidence in
256256
```{matlab}
257257
load('carsmall')
258258
259-
grpstats([Acceleration,Weight/1000],Cylinders,0.05)
259+
grpstats([Acceleration,Weight/1000],Cylinders,0.05);
260260
261261
fig2plotly(gcf);
262262
```
@@ -268,7 +268,7 @@ Plot mean acceleration, grouped by both `Cylinders` and `Model_Year`. Specify 95
268268
```{matlab}
269269
load('carsmall')
270270
271-
grpstats(Acceleration,{Cylinders,Model_Year},0.05)
271+
grpstats(Acceleration,{Cylinders,Model_Year},0.05);
272272
273273
fig2plotly(gcf);
274274
```

matlab/2021-08-04-lines-on-maps.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage])
232232
geolimits([45 62],[-149 -123])
233233
234234
geobasemap colorterrain
235+
236+
fig2plotly(gcf);
235237
```
236238

237239

matlab/2021-08-04-marginal-plots.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: marginal-plots.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Create a scatterhist Plot

matlab/2021-08-04-mixed-subplots.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: How to make Mixed Subplots in MATLAB<sup>&reg;</sup> with Plotly.
33
name: Mixed Subplots
44
display_as: multiple_axes
5-
order: 1
5+
order: 2
66
permalink: matlab/mixed-subplots/
77
thumnail_github: mixed-subplots.png
88
layout: base

matlab/2021-08-04-ml-regression.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This example shows how to perform simple linear regression using the accidents d
1717

1818
Linear regression models the relation between a dependent, or response, variable y and one or more independent, or predictor, variables x<sub>1</sub>,...,x<sub>n</sub>. Simple linear regression considers only one independent variable using the relation
1919

20-
<code>y=β<sub>0</sub>+β<sub>1</sub>x+ϵ,</code>
20+
* <code>y=β<sub>0</sub>+β<sub>1</sub>x+ϵ,</code>
2121

2222
where β<sub>0</sub> is the y-intercept, β<sub>1</sub> is the slope (or regression coefficient), and ϵ is the error term. This can be simplified to `Y=XB`
2323

@@ -28,7 +28,7 @@ load accidents
2828
x = hwydata(:,14); %Population of states
2929
y = hwydata(:,4); %Accidents per state
3030
format long
31-
b1 = x\y;
31+
b1 = x\y
3232
```
3333

3434

matlab/2021-08-04-parallel-coordinates-plot.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: parallel-coordinates-plot.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Parallel Coordinates Plot with Tabular Data
@@ -98,7 +99,7 @@ Create a new categorical variable that groups each patient into one of three cat
9899
```{matlab}
99100
load patients
100101
X = [Age Height Weight];
101-
p = parallelplot(X)
102+
p = parallelplot(X);
102103
103104
p.CoordinateTickLabels = {'Age (years)','Height (inches)','Weight (pounds)'};
104105

matlab/2021-08-04-polar-chart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ thumnail_github: polar-chart.png
88
layout: base
99
language: matlab
1010
page_type: u-guide
11+
published: false
1112
---
1213

1314
## Create Polar Plot

0 commit comments

Comments
 (0)