Plot single vector from 3D array

37 ビュー (過去 30 日間)
Brian
Brian 2015 年 1 月 15 日
回答済み: Sara 2015 年 1 月 15 日
I have a 5x5x150 3d array where I am saving a time series of correlations between variables. At the end of my code I'm attempting to plot the time series correlation between two variables with a command like plot(MyVar(1,1,:)). I get the error message that my data cannot have more than two dimensions because obviously MyVar(1,1,:) = a 1x1x150 3d Matrix. In that same command, how can I concatenate that command into a single vector so that it can be utilized by the plot command? The end value being plotted should by a 150x1 vector.
Hopefully my intention here is clear and thanks in advance for the help, Brian
  2 件のコメント
Sara
Sara 2015 年 1 月 15 日
It's better if you post the exact error matlab gives you. Try this:
plot(squeeze(MyVar(1,1,:)))
Brian
Brian 2015 年 1 月 15 日
編集済み: Brian 2015 年 1 月 15 日
Perfect, I knew there would be a simple command to do what I was intending. Thanks Sara. If you make your comment an answer I'll mark the question as answered.

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

採用された回答

Sara
Sara 2015 年 1 月 15 日
Try this:
plot(squeeze(MyVar(1,1,:)))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by