Store output in array

조회 수: 1 (최근 30일)
dhhtr
dhhtr 2015년 4월 21일
댓글: Star Strider 2015년 4월 21일
Hi everyone,
For the randomly generated points, I would like to store the output of 'position' as an array such that I can make reference to it in future.
I know this can be done when using a for loop, but is it possible to accomplish without the need of manually entering each result as a vector?
Any help would be kindly appreciated.
r=3;
m=10;
x=rand(1,m)*r;
alpha=pi*2*rand(1,m);
position=x.*exp(i*alpha)
Cheers.

채택된 답변

Star Strider
Star Strider 2015년 4월 21일
Your ‘position’ vector is a vector in your code.
What do you want to do with it?
  댓글 수: 4
dhhtr
dhhtr 2015년 4월 21일
Great! Thanks for the options, Star. I haven't come across the rng function before. It looks interesting - I will try it out.
Really appreciate the help. Have a nice day.
Star Strider
Star Strider 2015년 4월 21일
My pleasure!
You, too!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by