Figure with Plot and Martix

3 ビュー (過去 30 日間)
Stavros
Stavros 2011 年 7 月 12 日
Hello,
how is possible in the same figure to have plot of the data and at the same time the matrix values? example:
x=rand(10,1);
figure(1);
subplot(2,1,1);
plot(x);
subplot(2,1,2);
How to show my varialbles values?
Ty

回答 (1 件)

Paulo Silva
Paulo Silva 2011 年 7 月 12 日
x=rand(10,1);
figure(1)
subplot(2,1,1)
plot(x)
subplot(2,1,2);
t=1:numel(x);
hold on
arrayfun(@(v)text(v/10-1/10,x(v),num2str(x(v))),t)
  2 件のコメント
Stavros
Stavros 2011 年 7 月 12 日
Ty for your answer but I seeking something else.
subplot(2,1,2); i seeking to show variables values as are shown in workspace
Paulo Silva
Paulo Silva 2011 年 7 月 12 日
x=rand(10,1)
figure(1)
subplot(2,1,1)
plot(x)
subplot(2,1,2);
t=1:numel(x);
hold on
ylim([0 10])
text(0.45,11,'x=')
arrayfun(@(v)text(0.5,11-v,num2str(x(v))),t)

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by