Rank: 164073 based on 0 downloads (last 30 days) and 0 file submitted
photo

Anthony

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Anthony View all
Updated File Comments Rating
02 Jul 2014 Find and replace in selection Find and replace in currently selected editor text. Author: Sam Johnson

To solve the issue I raised in my last comment, you can simply:

- add the line: numberOfReplacements = numel(strfind(newText(startPos:endPos-1), oldSubstr));

before the line with strrep.

- change the penultimate line for:
[selectionPosition(3) selectionPosition(4)] = matlab.desktop.editor.indexToPositionInLine(activeEditor, endPos+numberOfReplacements*(numel(newSubstr)-numel(oldSubstr)));

01 Jul 2014 Find and replace in selection Find and replace in currently selected editor text. Author: Sam Johnson

01 Jul 2014 Find and replace in selection Find and replace in currently selected editor text. Author: Sam Johnson

Excellent! Thanks a lot!

I only have a little comment:
if you replace an expression by a longer expression (e. g. '*' by '.*') part of the selected text is deselected (the number of selected characters remains constant).

It can cause problems if you have to perform several replacements.

It could probably be solved by:
- making the difference (D) of the replacing expression length and the replaced expression length
- extending the selection after replacement of (number of replacement)*D

Anyway thanks a lot for your submission, it's really great :-)

25 Feb 2014 High intensity focused ultrasound simulator Simulates high intensity focused ultrasound beams and heating effects in layered media Author: Josh Soneson

Nice code, fast (axisymmetric calculation) and user-friendly.
It would be good to be able to specify more than 2 materials.

Contact us