How to plot an array in negative axes
2 ビュー (過去 30 日間)
古いコメントを表示
I have initialized an array using the following code:
xdim=6;
ydim=12;
V_new=zeros(xdim+1,ydim+1);
V_new(5,4:10)=15;
V_new
Now, I want to plot this array from x=-3:9 and y=0:6.
However, I am not sure how to plot the array at the negative x-axis.
3 件のコメント
dpb
2018 年 2 月 3 日
Say what!? You have an array that is all zeros except for seven elements in the 5th row that are a constant.
What's to plot and what possible relation is there between the array and two totally unrelated variables
x =-3:9
y = 0:6
???
採用された回答
dpb
2018 年 2 月 4 日
Ah...ok, now I see...presuming the array is assumed to match box boundaries, just define X,Y to match the dimensions you want--
X=linspace(-3,9,size(V,2));
Y=linspace(0,5,size(V,1));
contour(X,Y,flipud(V),15,'ShowText','on')
...
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!