Adding Dot For Linspace
Ältere Kommentare anzeigen
Hello friends,I have parametric equation about 5 paper,I want to add dot for every * and / signs to use linspace.How can I do automatically
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (1)
gonzalo Mier
am 6 Mai 2019
You have two possibilities here:
- In the text file, you replace * by .* and / by ./ in all the document (there is an option in the replace to replace all).
- If you have it like a function and want to do it by programming, you can overload the funtion mtimes and mrdivide by times and rdivide as:
function c = mtimes(a,b), c = times(a,b); end
function c = mrdivide(a,b), c = rdivide(a,b); end
You can add this to the end of your file or to your folder.
By preference, always do the first method, as overloading operators is not a good practice unless you try to ofuscate your code, but I have found some moments where it's the only way
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!