Extracting from a matrix

조회 수: 3 (최근 30일)
G
G 2018년 10월 26일
편집: Stephen23 2018년 10월 26일
I have a 6 row 800 column matrix... How do I extract the data in row 2 only to the 600th column?

채택된 답변

Stephen23
Stephen23 2018년 10월 26일
편집: Stephen23 2018년 10월 26일
Where A is your matrix:
B = A(2,1:600)
Basic MATLAB concepts, like how to use indexing, are explained in the introductory tutorials:
  댓글 수: 2
G
G 2018년 10월 26일
편집: G 2018년 10월 26일
Ok thank you. Can you help me with plotting also? I am trying to plot this: I keep getting an error about the vectors not being the same length
clear,clc
load('DATA_01_TYPE01.mat')
A = sig;
x = A(2,1:600)
t=0:200:600;
subplot(3,1,1)
plot(t,x)
Stephen23
Stephen23 2018년 10월 26일
편집: Stephen23 2018년 10월 26일
x has 600 elements, whereas t has exactly five elements:
>> t = 0:200:600
t =
0 200 400 600
It is not possible to plot 600 x points against 5 t points. Perhaps you meant this:
t = 0:599

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by