洛伦(Matlab)的艺术

Turn ideas into MATLAB

笔记

洛伦(Matlab)的艺术已退休,不会更新。

Evens和赔率

MATLAB中有很多功能,有时用户认为如果他们找不到自己想的功能,那是因为他们不知道名称。有时候是真的,有时是因为有一种快速,简便的方法可以完成任务。关于MATLAB新闻组regarding how to determine if numbers are even or odd.

最常见的答案涉及人们指向诸如REMandmod。但是,在这些相同的线程上,您会经常看到Urs Schwarzwarn about the limitations of those functions for the purpose of determining even/odd-ness. He has made a contribution,ISODDon the File Exchange that encapsulates the algorithm he prefers, based on he functionsBitmaxandbitandURS处理的主要问题无法完全处理基于解决方案的解决方案金宝搏官方网站REMormod包括非全能输入和比最大的浮点整数大的两倍。

If you do lots of error checking already, and know that your data is within acceptable bounds, you are probably fine using an approach based onREMormod。您是否有一个应用程序,例如URS发布的增强版本很重要?让我知道here




以MATLAB®7.8出版

|