필터 지우기
필터 지우기

Putting different outputs in one vector matrix

조회 수: 1 (최근 30일)
Hassanean
Hassanean 2017년 3월 17일
댓글: Hassanean 2017년 3월 17일
Hi Please could anyone have information about how can collect the many separate outputs in the one matrix where these outputs are results from running one equation for several times in matlab.
For example:
x= (1 2 3 4 5 6 7 8 9 ...............)
y=sinx-cosx
y1=? % for first value of x
y2=?? % for second value of x
.
.
.
.
y=????? % for last value of x
Required: collect all these output in one vector matrix [y1; y2; ....;yn]
regards,

채택된 답변

James Tursa
James Tursa 2017년 3월 17일
Is this what you want?
x = 1:9; % a vector with elements 1, 2, ..., 9
y = sin(x) - cos(x); % the vector result at each point of x

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by