Error using ==> plot Vectors must be the same lengths.

Hi! I have three input Mux to Scope. Run the simulation.Open the Scope block, select Parameter. Select the Data history tab, select the Save data to workspace. not select the Limit data points to last. select the type of structure with time.To graph out window Commandwindow, I use the command:
figure(1);
plot(ScopeData.time,ScopeData.signals.values(:));
grid on;
??? Error using ==> plot
Vectors must be the same lengths.
why? please help me!

回答 (1 件)

Wayne King
Wayne King 2012 年 9 月 16 日
編集済み: Wayne King 2012 年 9 月 16 日

0 投票

You have to have an x and y variable that are the same length
So
ScopeData.time and ScopeData.signals.values(:)
do not have the same length
For instance
x = 1:10;
y = randn(11,1);
plot(x,y)
So you should determine what the dimensions (sizes) are of
gives the same error. ScopeData.time and ScopeData.signals.values
If you need to, put a breakpoint on that line in the code that plots and then you can put your cursor over the inputs to see their sizes.

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2012 年 9 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by