Is possible configure matlab to get a+[ ]=a?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
ask question
Greetings people.
I currently sent some codes for a software that I developed, and I did not take into account that some values could be empty []. I get some empty values and i had to make a sum, but a + [] = []. It was a big mistake.
Is it possible to configure any option to get a + [] = a without using isEmpty or a command?
Thank you in advance.
0 Commenti
Risposte (2)
Matt J
il 4 Dic 2019
No way that you're going like. You could subclass Matlab's double type
Then, you can overload the @plus method
2 Commenti
Rik
il 5 Dic 2019
Thank you Matt.
Do you know if is possible edit the double class or plus function in MatLab?
Rik
il 5 Dic 2019
You should be really careful with editing base components of internal Matlab functions, see this comment for an example why.
Did you try following the advice in the linked pages?
I would strongly suggest using the sum method instead.
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!