Posts

Es werden Posts vom Juni, 2016 angezeigt.

Matlab: Open and plot all files in register

Open and plot of all files in a register ( German ) This plot is about to open and plot all files in a register with Matlab. First of all, all files with the format *.txt are opend and saved in files. files = dir('*.csv'); For value = 2 just every second file is saved. for i = 1:1:length(files)/value     fid3{i}=files(i).name; end To sort these files by name you need to download "natsortfiles" from Matlab-Exchang: fid3 = natsortfiles(fid3) for i = 1:value:length(files)      fid = fopen(fid3{i});     daten = textscan(fid,'%f %f','delimiter',',','headerlines',0');     q1(:,i/value) = daten(1);     q2(:,i/value) = daten(2); end fclose(fid); In "textscan" with 'headlines',0 is the amount of rows are defined which are delited from the text file. The files from coulomn 1 are saved in q1 and from coulomn 2 are saved in q2. Furthermore the files are opened and saved in a matrix and in a defined area

Matlab: Colorspectrum

Bild
Colorspectra with Matlab ( German ) This post is about a Matlab-function, to generate colorspectras for multiple plots. Therefor you can change the colorsweep in different way. This is the function ( Download ): function [CoolSpec] = ColSpec(a,q,value,start) On can define with "a" the amount of different colors in the area between red over yellow to green to blue to pink and further to red. q displays the q'th value of the generated spectra. With "value" the width of the spectra is described wherefor value>1 decreases the spectrawidth. "start" is the startingvalue for the color. Therefor red is (start = 0), yellow (start = 0.5), green(start = 1), brightblue (start = 1.5-2), darkblue(start = 2.5) and pink (start = 3) and the again red and so on. With "m" and "k" is the darkness for values smaller 1. "inv" inverte the colorspec for values unequal zero from blue over green to red. Here a different parameters sh