필터 지우기
필터 지우기

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 CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by