This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % function file 'dblint.m' | |
| % evaluates dblquad(f, x1, x2, y1, y2) | |
| % where f is an anonymous function of x and y | |
| % y1 and y2 are anonymous functions of x | |
| % x1 and x2 are real numbers | |
| function val = dblint(f, x1, x2, y1, y2) | |
| f2 = @(x, u) f(x, y1(x) + u.*(y2(x) - y1(x))) .* (y2(x) - y1(x)); | |
| val = dblquad(f2, x1, x2, 0, 1); | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % function file 'linReg.m' runs a standard linear regression analysis | |
| % syntax: [P r] = linReg(x, y) | |
| % displays regression equation and correlation data, draws scatter plot | |
| % optional return values P: regression equation, r: correlation coefficient | |
| function [P r] = linReg(x, y) | |
| % calculate regression and correlation | |
| P = polyfit(x, y, 1); | |
| r = corr(x, y); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % script file 'cave_spline.m' | |
| % generates spline curves for walls, ceiling, and floor | |
| % plots plan and profile views of survey line and spline model | |
| % requires 10x1 station coordinate vectors x, y, and z and 10x4 lrud data matrix | |
| % extract left, right, up, down from lrud data matrix | |
| load csurvey_data.txt | |
| L = lrud(:, 1); | |
| R = lrud(:, 2); | |
| U = lrud(:, 3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Created by Octave 5.1.0, Wed Feb 19 09:02:40 2020 GMT <unknown@jlachniet-LT> | |
| % name: data | |
| % type: matrix | |
| % rows: 9 | |
| % columns: 3 | |
| 30.05 248.5 -15.5 | |
| 10.3 237.5 -25.5 | |
| 3.2 245 11 | |
| 17 269 -5 | |
| 10 271 -10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mesh2stl(filename, X, Y, Z, delta) | |
| %MESH2STL writes an .stl (STereoLithography) file from meshgrid variables | |
| % mesh2stl('filename', X, Y, Z) | |
| % produces a triangulated mesh from meshgrid variables X, Y, Z | |
| % and writes output to 'filename' in stl format | |
| % --X, Y, Z must be two dimensional arrays of the same size | |
| % --optional: if delta is provided, produce a solid block from the graph | |
| % of surface z = f(x, y) | |
| % where 'delta' gives minimum thickness between base of block | |
| % and graph of surface |