matlab中rem函数
时间: 2024-04-23 07:29:00 浏览: 177
在Matlab中,rem函数用于计算除法的余数。它的原理是通过使用fix函数和floor函数来进行取整操作。具体来说,rem(x,y)命令返回的是x-n.*y,其中n = fix(x./y)。而mod(x,y)函数返回的是x-n.*y,其中n=floor(x./y)。这两个函数的生成机制不同,rem函数采用fix函数,而mod函数采用floor函数。需要注意的是,当除数y等于0时,rem函数的结果为NaN。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [matlab取整函数与取余函数](https://blog.csdn.net/edward_zcl/article/details/122332765)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [【 MATLAB 】rem 函数介绍](https://blog.csdn.net/Reborn_Lee/article/details/83504843)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [matlab中rem函数的使用(取余数)](https://blog.csdn.net/iii66yy/article/details/128552317)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文