フィルターのクリア

Extracting from a matrix

2 ビュー (過去 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 Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by