Rank: 97 based on 528 downloads (last 30 days) and 8 files submitted
photo

Pekka Kumpulainen

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Pekka View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
23 Jun 2010 Screenshot tight subplot Fills the figure with axes subplots with easily adjustable margins and gaps between the axes. Author: Pekka Kumpulainen plot, subplot, visualization, potw, pick of the week 352 19
  • 4.66667
4.7 | 31 ratings
04 Nov 2009 howmany Counts occurrencies of numbers in array Counts the number of occurrences of finite values Author: Pekka Kumpulainen count numbers 10 2
09 Jun 2009 fix_x_limits Forces the same XLim to all axis Author: Pekka Kumpulainen graphics, xlim, axis limits 7 0
08 Jan 2009 Replace strings in text file REPLACEINFILE replaces characters in ASCII file using PERL Author: Pekka Kumpulainen strings, replace string perl 44 27
  • 4.72727
4.7 | 24 ratings
12 Jun 2008 Screenshot Bullshit Bingo Interactive Bullshit Bingo, right click on background for new Author: Pekka Kumpulainen games, interactive bullshit ..., game, bingo, interactive 13 0
  • 5.0
5.0 | 1 rating
Comments and Ratings by Pekka View all
Updated File Comments Rating
26 Jan 2012 Colored line or scatter plot Plot lines with CData, (actually surface) Author: Pekka Kumpulainen

^ works fine up to million elements (didn't try with more).
The function does NOT refresh the plot. It only adds a new colored line.
Maybe you should clear the figure (clf).

12 Nov 2009 howmany Counts occurrencies of numbers in array Counts the number of occurrences of finite values Author: Pekka Kumpulainen

The exact equal match is intentional in this function. I have another function: "isclose" for the "close enough" comparisons.
But a good suggestion anyway, I might add that option.

Comments and Ratings on Pekka's Files View all
Updated File Comment by Comments Rating
19 Aug 2014 Colored line or scatter plot Plot lines with CData, (actually surface) Author: Pekka Kumpulainen Julian

I found this technique very useful. It seemed relevant to the discussion at
http://blogs.mathworks.com/videos/2014/08/12/coloring-a-line-based-on-height-gradient-or-some-other-value-in-matlab/#comment-41206
where I posted a comment referencing to this submission. Thanks.

19 Feb 2014 Replace strings in text file REPLACEINFILE replaces characters in ASCII file using PERL Author: Pekka Kumpulainen Steven

I had trouble replacing some trouble when the string I wanted to replace had '.' symbol. I am using MATLAB 2013b on Ubuntu 12.04 kernel 3.2.0-58-generic.

I ran the function like this:
>> replaceinfile('.iq','.buf','file1.txt','file2.txt')

This function worked correctly for one line of my file (the one I wanted to change):

sOpt.suffix = '.iq';

became

sOpt.suffix = '.buf';

The problem occurred for this line (which I did not want to change):

sOpt.datadir = 'iqdata/';

became

sOpt.datadir = .bufdata/';

I found I had no problems if I ran the function either of the following ways:
>> replaceinfile('\.iq','\.buf','iqpro_setup.txt','test.txt')
>> replaceinfile('\.iq','.buf','iqpro_setup.txt','test.txt')

Maybe this is a trait of PERL, not sure. Thought I'd share on the off chance that anyone else runs into that problem.

Thanks for the code.

13 Jan 2014 MY_XTICKLABELS Replaces XTickLabels with "normal" texts accepting multiline texts and TEX interpreting Author: Pekka Kumpulainen Lin, Liaofan

11 Nov 2013 Replace strings in text file REPLACEINFILE replaces characters in ASCII file using PERL Author: Pekka Kumpulainen Jose

Works very well, I am using it to generate a batch of files from a single template. I am replacing two strings in a template and creating a file everytime. Is there a way to replace multiple strings in one shot?
The way I do it now is:
1. Open template, replace first string, save with new name.
2. Open new file, replace second string.

19 Sep 2013 Replace strings in text file REPLACEINFILE replaces characters in ASCII file using PERL Author: Pekka Kumpulainen Phillip

Great. This was just what I needed. I added a multiselect uidetfile beforehand so I could do a batch replace on a large number of files and it worked perfectly.
---
[files] = uigetfile('*.txt','multiselect','on');

cnt = length(files);

for i = 1:cnt
s = replaceinfile(oldStr,newStr,files{i});
end

Contact us