フィルターのクリア

use rand in editor

1 回表示 (過去 30 日間)
David bondi
David bondi 2012 年 4 月 7 日
I was given a script to edit with the function "randi" in it, i have a older version of matlab R14. It worked on the latest version, curious if there is n easy conversion to fix this issue.
  3 件のコメント
David bondi
David bondi 2012 年 4 月 7 日
yea that is right
David bondi
David bondi 2012 年 4 月 7 日
if i change the randi() to rand() which my version can handle it errors with matrix not being the same and rendering mesh

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2012 年 4 月 7 日
You can define your own randi like this:
function out = randi(iMax, rows, columns)
out = int32(floor(iMax*rand(rows, columns) + 1));
Of course that is not as flexible in the types of input arguments that the real randi() accepts, but you can work on that if you want.

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by