Skip to content

Instantly share code, notes, and snippets.

View KuanYuChang's full-sized avatar

Kuan-Yu Chang KuanYuChang

  • ASMedia Technology Inc.
  • Taipei, Taiwan
  • 01:13 (UTC +08:00)
View GitHub Profile
@KuanYuChang
KuanYuChang / plot_conic_sections.m
Created May 31, 2018 13:28
plotting two examples of conic sections
figure;
subplot(2, 2, 1);
fimplicit(@(x, y) (x.^2) - x.*y + (y.^2) - sqrt(2).*x + 2*sqrt(2).*y - 4, [-5 5 -5 5]);
grid on; title('ex1-origin');
subplot(2, 2, 2);
fimplicit(@(x, y) (x.^2) - x.*y + (y.^2) - 6, [-5 5 -5 5]);
grid on; title('ex1-translation');
subplot(2, 2, 3);
clear;
%% Data Set
t = [-2; -1; 0; 1; 2];
y = [ 4; 3; 1; -1; -3];
%% Degree of approximation
% n = 1; % linear
% n = 2; % quadratic
% n = 3; % cubic
@KuanYuChang
KuanYuChang / fourier_approx.m
Last active March 30, 2018 05:00
Demo of the Fourier Series
%% Remove items from workspace
clear;
%% Interval of x
x = linspace(-10, 10, 10000);
%% Example 1
orig = x;
a_0 = 0;
a_k = @(k) 0;
@KuanYuChang
KuanYuChang / tensorflow_test.py
Created August 4, 2017 13:10
testing tensorflow
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))