Hi,
I'm not sure. I tried some experiments, and things seemed okto me running on Linux.
You should probably dbstop in my_func, and then see what kind of command it is generating when you use run region to see if there is some sort of line ending problem.
Eric
-----Original Message-----
From: Elliot Joel Bernstein [mailto:ell...@fd...]
Sent: Thursday, November 12, 2009 10:39 AM
To: mat...@li...
Subject: [Matlab-emacs-discuss] Run-Region Problem
I'm having trouble running a block of code that makes calls to a function
that saves data to and then loads it from an external file. For example, I
have written the function 'my_func':
function R = my_func(n)
[r,v]=system('echo -n $PPID');
idx = regexp(v, '\^\[$');
if ~isempty(idx)
v = v(1:idx-1);
end
filename = ['/tmp/my_func_file_' v '.mat'];
save(filename, 'n');
n = load(filename);
system(sprintf('rm %s', filename));
R = n;
I then call my_func multiple times from test.m:
my_func(3)
my_func(4)
my_func(5)
If I run test.m using 'Save and Go', it works fine. But if I highlight the
three calls to my_func and run them using 'Run Region' I get the following:
>> my_func(3)
/bin/bash: -c: line 0: syntax error near unexpected token `('
my_func(4)
my_func(5)
/bin/bash: -c: line 0: `rm /tmp/my_func_file_11093my_func(4)'
ans =
n: 3
>> my_func(4)
/bin/bash: -c: line 0: syntax error near unexpected token `('
my_func(5)
/bin/bash: -c: line 0: `rm /tmp/my_func_file_11093my_func(5)'
ans =
n: 4
>> my_func(5)
ans =
n: 5
Any suggestions how to solve this?
Thanks.
- Elliot
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matlab-emacs-discuss mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss
|