채택된 답변

Image Analyst
Image Analyst 2014년 3월 8일

0 개 추천

Try this:
Z=[43;-57;98;23;-13;243;-98;112;325;560]
elementsToExtract = randperm(numel(Z), 5)
z5 = Z(elementsToExtract)

댓글 수: 3

Tinkul
Tinkul 2014년 3월 8일
Sorry sir,i gives error.In the command window it shows the following error:
??? Error using ==> randperm Too many input arguments.
Error in ==> Untitled at 5 elementsToExtract = randperm(numel(Z), 5);
You must have a really old version of MATLAB. What version/release do you have? You can extract the 5 yourself:
Z=[43;-57;98;23;-13;243;-98;112;325;560]
elementsToExtract = randperm(numel(Z))
z5 = Z(elementsToExtract(1:5))
Tinkul
Tinkul 2014년 3월 8일
Thanx sir. Now its working...I have matlab 7.8.0(R2009a) version...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2014년 3월 8일

댓글:

2014년 3월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by