Skip to content

Instantly share code, notes, and snippets.

@Boogalbee
Boogalbee / Formatting.c
Last active August 29, 2015 14:09
Simple User I/O and Static Vars
#include <iostream>
#include <stdio.h>
//void main()
{
int inum = -9234;
double fnum = 251.7366;
printf("Integer Formats:\n\tDecimal: %i\n", inum);
@Boogalbee
Boogalbee / Grades.c
Created November 15, 2014 05:04
File I/O
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int A()
{
FILE * ip;
float sum = 0.0, grade, avg, Maxgrade, Mingrade;
@Boogalbee
Boogalbee / FunctionCalling.c
Created November 15, 2014 05:07
Calling Functions
#include <iostream>
#include <stdio.h>
double getD(char * msg)
{
double local;
printf("%s: ",msg);
scanf("%lf",&local);
return local;
}
//Alec Bewsee
//updated:2-8-14
#include <iostream>
#include <stdio.h>
#include <math.h>
int findSlot(float h[], float h_x)
{
int k, slot;
for (k = 0; k<8; k++)
@Boogalbee
Boogalbee / impls_fn.m
Last active August 29, 2015 14:09
Signal approximation functions in Matlab
% A function generating a rectangular approximation for
% the unit impulse function; width is delta
%
function imp = impls_fn(t, delta)
imp = zeros(size(t));
imp = (stp_fn(t+delta/2)-stp_fn(t-delta/2))/delta;