フィルターのクリア

Matrices with MathLAB..

3 ビュー (過去 30 日間)
Jon Camilleri
Jon Camilleri 2015 年 11 月 10 日
編集済み: Stephen23 2015 年 11 月 10 日
"Try creating a variable named x that is a 5-by-5 matrix of random numbers." Sourced from Mathlab on ramp - https://matlabacademy.mathworks.com.
Answer proposed is: x=rand(5).
How did I tell the engine to generate a 5x5 matrix and can I change the r*c configuration of the matrix? What other fancy calculations can I make with matrices, vectors and other structures?
  1 件のコメント
Jon Camilleri
Jon Camilleri 2015 年 11 月 10 日
NOTE: I think that this forum did not recognize my line break when I hit the enter key after the first sentence.

サインインしてコメントする。

回答 (2 件)

Stephen23
Stephen23 2015 年 11 月 10 日
編集済み: Stephen23 2015 年 11 月 10 日
The most useful thing you can learn about MATLAB is to read the documentation. This is because the documentation tells you how MATLAB works, and how it should be used. Although online forums are great, they are no replacement for actually reading the documentation.
Do an internet search for that function rand and the first result is likely to be the documentation. Trying "MATLAB rand" returns this as the first result:
And then on the second line of the "Description" section at the top of that page, we find an example which exactly matches your example: " X = rand(n) returns an n-by-n matrix of random numbers." It also shows how you can define the matrix to have different numbers of rows and columns.
Summary: when we read the documentation we learn how the functions work.

Thorsten
Thorsten 2015 年 11 月 10 日
You can get help on Matlab's functions using
help rand
or
doc rand

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by