How to make the x and y vector the same length

16 ビュー (過去 30 日間)
Junyao Zhang
Junyao Zhang 2020 年 11 月 22 日
コメント済み: Junyao Zhang 2020 年 11 月 22 日
subplot(7,3,[7 16]+2); hold on;
sess5.LRx=linspace(-135,135);
plot(sess5.LRx,sess5.time,'b');
This is the code I have, The sess5.time got more than 10,000 elements, how can I make it work?

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 11 月 22 日
編集済み: Cris LaPierre 2020 年 11 月 22 日
Take a look at the documentation for linspace.
If you only input the start and stop values, linspace creates a vector with 100 values. You can include a third input to specify the number of values to create. You can use the length command to determine the maximum dimesion of a variable. Use this to automatically determine the number of values to create.
sess5.LRx=linspace(-135,135,length(sess5.time));
  1 件のコメント
Junyao Zhang
Junyao Zhang 2020 年 11 月 22 日
So I need to add a n here to make it equal...Thank you

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by