How to generate a 1D array of zeros in Matlab?
292 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to create an 1D array of 100,000 elements in matlab full of zeros
0 Kommentare
Antworten (2)
Jan
am 24 Mär. 2021
Bearbeitet: Jan
am 24 Mär. 2021
Please read the Getting Started chapters of the documentation and Matlab's Onramp: https://www.mathworks.com/learn/tutorials/matlab-onramp.html
It is not efficient if beginners ask all basic details in the forum.
x = zeros(1, 100000)
2 Kommentare
José Montoya
am 5 Mär. 2022
What do you mean, not efficient? Let every detail be asked and every possible line on matlab show up on a google search!
The forum won't be crashing, and mathworks won't go broke on server space from a couple extra million questions.
Jan
am 6 Mär. 2022
@José Montoya: Asking a question in the forum means to wait 10 minutes to 3 days in average for the answer. Therefore reading the documentation are running the online tutorials is much more efficient for the users, because it is faster and clarifies dozens of standard questions in a compact way. Asking them all would takes weeks until a beginner can start to write useful codes. With the tutorials this takes 1 or 2 hours only.
Remember, that this forum does not live from questions only, but from the answers. The answering persons are volunteers and their time is valuable. Then asking for details, which are explained in the tutorials and manuals exhaustively already, is not efficient, but it wastes time, which could be spent in answers, which are not found elsewhere already.
"The forum won't be crashing" - I do disagree. The forum would crash, if all beginners ask for all details, because then the forum is to boring to particpate and filled with noise. This is not a question of the servers, but on the persons, who post answers in their sparetime.
Sometimes it more useful to tell a user, how he or she can solve the problems by their own. It is like telling someone how to fish, instead of giving one fish.
The top 10 answers have posted about 170'000 answers since this forum was started in 2009. Some million additional questions would kill the forum.
Feel free to give as many answers as you can, for advanced or beginner questions.
William Rose
am 24 Mär. 2021
data=zeros(100000,1); %column vector
data=zeros(1,100000); %row vector
0 Kommentare
Siehe auch
Kategorien
Mehr zu Startup and Shutdown 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!