필터 지우기
필터 지우기

Creating a variable to from data in a matrix

조회 수: 14 (최근 30일)
Cameron Lissarrague
Cameron Lissarrague 2020년 4월 26일
댓글: Cameron Lissarrague 2020년 4월 26일
I have loaded a text file and it is currently set as a variable, input1, in matrix form. I need a vector that is equal to the variables in this matrix of the first column from the 3rd row to the last row of the column.
Correct me if i am wrong but I believe to create a vector of the entire column can be done like this:
x = input1(:,1);
Is there a similar way to code this to only take the values starting at the third row?
Right now I have created column vectors consisting of the colums in the matrix. Then I wrote this but it does not seem to work either.
x = column1(3,:)
I have also transposed this and it still is not seeming to work. I am unsure what to do and would appreciate any help!
Thank you

채택된 답변

Imanol Isasa
Imanol Isasa 2020년 4월 26일
Hi,
you can select the first column starting from the third row doing this:
selection = matrix(3:end,1);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by