Skip to content

Instantly share code, notes, and snippets.

@shevkoplyas
shevkoplyas / gist:d9dc780ee857fa0f5ab6c5980bbb551d
Created August 19, 2025 05:15
After watching the excellent YouTube lecture: "Compressive Sensing" — https://youtu.be/rt5mMEmZHfs?si=gEvXWluUf3dBwT2Q this gist is an attempt on R translation of the lecture’s MATLAB code (works)
# After watching the excellent YouTube lecture:
# "Compressive Sensing" — https://youtu.be/rt5mMEmZHfs?si=gEvXWluUf3dBwT2Q
# Which I found in refernces from even more awesom video:
# "X-ray backscatter with compressed sensing algorithm"
# https://www.youtube.com/watch?v=EuVgGrun1V0 (time to start building The Thing!-)
#
# Below is an R translation of the lecture’s MATLAB code.
# Original MATLAB line #1: clear all; close all; clc
# Equivalents of: clear all; close all; clc
@shevkoplyas
shevkoplyas / aprintf
Last active August 29, 2015 14:10 — forked from EleotleCram/aprintf
int aprintf(char *str, ...) {
int i, j, count = 0;
va_list argv;
va_start(argv, str);
for(i = 0, j = 0; str[i] != '\0'; i++) {
if (str[i] == '%') {
count++;
Serial.write(reinterpret_cast<const uint8_t*>(str+j), i-j);