how to initialize array
78 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi friends how to initialize array in matlab
2 Kommentare
roxnvols
am 31 Aug. 2020
For those looking to initalize a 1D array of specific length mxn and value x:
x.*ones(m,n)
Enjoy the non condenscending answer!
Walter Roberson
am 31 Aug. 2020
ones(m,n) would produce a 2D array unless one or both of m or n are 1
Antworten (1)
Guillaume
am 19 Mär. 2015
Bearbeitet: Rik
am 7 Okt. 2021
Going through the very first tutorial in the documentation would have told you that. Or the introduction of any book on matlab.
This is the very basics of matlab.
Since the link above is to the then-newest R2015a release, the link is no longer working as intended. This link should keep working (unless Mathworks decides to move/split the page in a future release).
2 Kommentare
Walter Roberson
am 4 Okt. 2019
Alexander Daniels comments:
Did not answer the question, and instead opted to be condescending
Walter Roberson
am 4 Okt. 2019
Alexander:
The link provided was directly to material that shows the initialization of matrices, and so does answer the question.
There is no requirement in this MATLAB Answers facility that the volunteers answer in their own words or copy copyrighted material: it is acceptable for the volunteers to post links to the desired information -- or, for that matter, even just links to entire groups of discussion of the topic where the solution is "somewhere" in the group.
Siehe auch
Kategorien
Mehr zu Operators and Elementary Operations 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!