Filter löschen
Filter löschen

Putting different outputs in one vector matrix

1 Ansicht (letzte 30 Tage)
Hassanean
Hassanean am 17 Mär. 2017
Kommentiert: Hassanean am 17 Mär. 2017
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,

Akzeptierte Antwort

James Tursa
James Tursa am 17 Mär. 2017
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

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by