how to change Function value intiialization? mine is start with 0. i want start with -1
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Neptune16
am 10 Dez. 2017
Kommentiert: Neptune16
am 10 Dez. 2017
f = zeros(1,length(t));
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 10 Dez. 2017
The trivial answer is to subtract one from the array of zeros.
Or, replace the zeros with -1. Thus
f(:) = -1;
Or, learn to use the function ones. It works just like zeros. Multiply by -1.
Or, learn to use repmat. Thus repmat(-1,[1,nt]).
Or many other solutions.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!