Borrar filtros
Borrar filtros

How to generate a 1D array of zeros in Matlab?

178 visualizaciones (últimos 30 días)
Devika Waghela
Devika Waghela el 24 de Mzo. de 2021
Comentada: Jan el 6 de Mzo. de 2022
I want to create an 1D array of 100,000 elements in matlab full of zeros

Respuestas (2)

Jan
Jan el 24 de Mzo. de 2021
Editada: Jan el 24 de Mzo. de 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 comentarios
José Montoya
José Montoya el 5 de Mzo. de 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
Jan el 6 de Mzo. de 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.

Iniciar sesión para comentar.


William Rose
William Rose el 24 de Mzo. de 2021
data=zeros(100000,1); %column vector
data=zeros(1,100000); %row vector

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by