Skip to content

Commit 2704eea

Browse files
committed
update
1 parent 38fc183 commit 2704eea

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Matlab function library
2-
3-
My own matlab functions
1+
# Matlab functions
42

3+
My own Matlab functions

fun/csvcommadecimal.m

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function y = csvcommadecimal(filename)
2+
% Reads .csv files that have ',' instead of '.' as decimal separator
3+
4+
Data = fileread(filename);
5+
Data = strrep(Data, ',', '.');
6+
FID = fopen('temp.csv', 'w');
7+
fwrite(FID, Data, 'char');
8+
fclose(FID);
9+
10+
y = readtable('temp.csv');
11+
delete('temp.csv')
12+
end

fun/nicegif.m

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
function [] = nicegif(x,y,n,delay,filename)
22
% Function to make 2D gifs
33
% y is function of x and n, where n varies each frame
4+
% Example:
5+
% a = 0:0.01:2;
6+
% fun = @(x,n) sin(2.*pi.*(x-n));
7+
% t = 0:0.01:1;
8+
% nicegif(a,fun,t,0.05,'wave.gif')
49

510
f = figure;
611
axis tight manual % this ensures that getframe() returns a consistent size

0 commit comments

Comments
 (0)