Skip to content

Instantly share code, notes, and snippets.

View DiamondLovesYou's full-sized avatar

Richard Diamond DiamondLovesYou

View GitHub Profile
DEBUG:cargo::update: executing; cmd=cargo-update; args=["cargo", "update"]
DEBUG:cargo::core::registry: load/missing file:///home/dick/Dropbox/workspace/cargo-bug
DEBUG:cargo::core::registry: load/missing registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index
DEBUG:cargo::core::registry: load/precise registry https://github.com/rust-lang/crates.io-index

Exercise2_13.m

A = [1 2 3; 4 5 6; 7 8 9.01];
[A2, success, pivots, cond] = Factor(A);

[m,n] = size(A2);
x = zeros(m, 1);

main.rs

type Mat = [[f64; 4]; 3];
const P: Option<f64> = Some(0.1);

fn chopped(exact: f64, p: Option<f64>) -> f64 {
    if let Some(p) = p {
        let exact = exact * (1.0 + p);

This is kinda a reply to /u/HeroesGrave's reply. Over the past year+, I've put a lot of thought into creating a solid GUI library. I know I'm kinda late to the party (until now, I hadn't written this down, other than what been coded), nonetheless here are my thoughts.

Some areas I've left kinda vague, hoping that readers would be able to extrapolate. Feel free to fork/PR, comment, critique etc.

Goals

Exercise2_15.m

v = 50;
A = [
    11 -5 0 0 0 -1;
    -20 41 -15 0 -6 0;
    0 -3 7 -4 0 0;
    0 0 -1 2 -5 0;
 0 -3 0 -10 28 -15;

Exercise2_16.m

A = [
    0.473 -0.115 0;
    0.731 -0.391 0.267;
    0     -0.782 0.979;
A = [
0.172 0.013 0.144;
0.368 0.681 0.271;
0.099 0.510 0.329;
];
[A2, success, pivots, cond_num] = Factor(A);
assert(success == 0, 'failed to factor A');
function [ ] = E4_10helper( function_file )
%E4_10HELPER Holds common code used in each part.
global nfeval
b = 1;
c = 0;
abserr = 1e-8;
relerr = 1e-6;

Problem 4.13

e413.m

abserr = 1e-8;
relerr = 1e-6;

figure;
fplot(@(x) cot(x) - (x^2 - 1) / (2*x), [0 10, -10, 10]);
@DiamondLovesYou
DiamondLovesYou / e415.md
Created October 25, 2016 15:35
Problem 4.15

Problem 4.15

e415.m

abserr = 1e-8;
relerr = 1e-6;

figure;
fplot(@e415f);