フィルターのクリア

New to matlab, trying to understand basic functions still

1 回表示 (過去 30 日間)
Kayla
Kayla 2023 年 11 月 2 日
回答済み: John D'Errico 2023 年 11 月 2 日
Hello! I am new to matlab and I am working with some data, however, I am trying to understand what it means with the following (hopefully this makes sense):
x= D0a(:,1); nf=length(x);
y=(1:9)'; ns= length(y);
D0a is the element.

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 11 月 2 日
編集済み: Sulaymon Eshkabilov 2023 年 11 月 2 日
The meaning of these entries are:
x= D0a(:,1); % The existing variable D0a's column 1 is assigned to a new variable called x
nf=length(x); % Counting the length of x (vector)
y=(1:9)'; % Creating y vector, transposing 1 to 9 (row vector) into 1:9 column vector
ns= length(y); % Counting the length of y (vector)
% to get help on any of MATLAB functions use: help
help length
help transpose
% Advice: study MATLAB Onramp

その他の回答 (2 件)

the cyclist
the cyclist 2023 年 11 月 2 日
Assuming that D0a is a matrix, then
  • x is the 1st column of that matrix. (x is a column vector.)
  • nf is the number of elements in that vector x.
  • y is the vector [1 2 3 4 5 6 7 8 9], but then transposed to be a column vector, rather than a row vector.
  • ns is the number of elements in that vector y.
You are right that these are very basic questions. I strongly suggest you invest a couple hours in viewing the free MATLAB Onramp online tutorial.

John D'Errico
John D'Errico 2023 年 11 月 2 日
If you are this new to MATLAB, then you seriously need to spend some tie reading the tutorials available.
The MATLAB Onramp is a good place to start. But there are also many other things you can read. Why not read the manual? Yes, I know, you don't need no steenkin' mauals. Spend a couple of hours. It will pay dividends.

カテゴリ

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