Filter löschen
Filter löschen

how to store a matrix in variables

5 Ansichten (letzte 30 Tage)
Newman
Newman am 22 Feb. 2016
Beantwortet: Dennie am 22 Feb. 2016
Hello ,
I want to store the following code in the variable:
p=[p(0)...p(M-1)]';
where m is any integer
I am unable to write a code for it .kindly help

Akzeptierte Antwort

Dennie
Dennie am 22 Feb. 2016
I think this is what you want:
input_vector=[ 1 2 3 4 5 6 7 8 9 10];
for i=1:M
p(i)=input_vector(i);
end
Matlab code starts arrays with index 1 and not 0, the example that you have given is coherent to c# style arrays.
Hope this helps,
Dennie

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by