Hi Eric,
On Dec 2, 2005, at 8:43 AM, Eric Ludlam wrote:
> Thanks. I know this feature is something I have had some requests
> for. I like the idea of using paragraph-start, though I do not know
> the origins of the current values. Another option might be to use
> page-delimiter instead. What is a paragraph of M code anyway? ;)
Something Mathworks has in it's Editor. i.e.
%% Do something
% this is a "paragraph"
x=1:100
y = cos(x);
%% Plot something
% this is another "paragraph"
plot(x,y)
xlabel('x');
ylabel('y');
%%%%
I find it very useful to run parts of long scripts this way. When
analyzing data you can either make an m-file for each "block" of
code, which gets unwieldly fast, or do it all in one long script.
Usually the script takes too long to run everytime you want to change
the xlabel on a plot so running bits of it is very convenient. You
can highlight a block and run it, but that requires more keystrokes.
Blocking the code like this is invaluable to my work flow.
Cheers, Jody
> Eric
>
>>>> mail-vif.mathworks.com ([144.212.95.18]) by MESSAGE-
>>>> AH.ad.mathworks.com with Microsoft SMTPSVC(6.0.3790.211); seems
>>>> to think that:
>> Hi all,
>>
>> In light of the new mailing list I thought I'd share this. I kludged
>> up the following snippet to mimic the Matlab editor's ability to run
>> a block of code between two "%%" markers. It also allows you to use
>> "paragraph-forward" and "-backwards" on chunks of code.
--
Jody Klymak
http://opg1.ucsd.edu/~jklymak/
|