現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
0 投票
Hey every1,
I am working on a small set of data to learn how to do it in my actual work !! I created two plots and the second plots I replaced the content of the plot with the content of the first plot and left the first 3 entries out I made it NaN, so the point is now my two plots are actual identical apart from my second plot b is shifted by 3 where I made it NaN.. I want to put both plot on the same graph and scale by some amount so I will be able to see the both the same apart from one is shifted.. I know I need hold on in the plot to plot them both together but I am not sure how to scale it so I will be able to see it??? How can you scale a plot by some amount to bring down a bit ???
Thanks in advance,
採用された回答
Fangjun Jiang
2011 年 7 月 27 日
axis([Xmin Xmax Ymin Ymax]);
11 件のコメント
Paulo Silva
2011 年 7 月 27 日
there's also the functions xlim and ylim
Fangjun Jiang
2011 年 7 月 27 日
@Paulo, is there any subtle difference between axis() and xlim(), ylim()?
Susan
2011 年 7 月 27 日
I tried it its doing something but the whole plot went wrong but I think I have another problem, I have my (x,y) and the other plot (f,z) as I explained I copied the content of the second plot(f,z) to the first (x,y) and left the first 3 so if you know what I mean they have the same exact pair of values apart from the first 3 which i explained what i did.. because in Matlab worksapce I had x,y,f,z all variables hold 1x100 I concatenated (x,y) to one array a= (x,y) and same for b = (f,z) so I can do the coping values as explained above I wanted to get the pair of value but the problem is when I do plot(a) or even plot(b) separately it totally do something else it produce wrong graph.. Is in it plot(a) should be equivalent to plot(a,b)? I just had to concatenated them for the reason explains but it produce wrong plot???? because of this problem now i can see the scale?
Susan
2011 年 7 月 27 日
Just to make it easier the plot starts the coping values part
a(1,4) = b(1,1) then a(1,5)=b(1,2) then a(1,6)=b(1,3) etc.. a(1,1) to a(1,3) are NaN
Paulo Silva
2011 年 7 月 27 日
Fangjun, when used to set the limits they are basically the same with one obvious difference, with xlim you can change the x limits without touching on the y limits, also the xlim can be used to retrieve the x limits of the current axes, same goes for ylim and zlim.
Paulo Silva
2011 年 7 月 27 日
Susan I can't understand what you are trying to do, sorry about that.
plot(a)
when a is a vector it plots the amplitude of a in the y part of the axes and the index in the x part of the axes, example a=[1 10 20]
plot(a) draws a line between the points with coordinates
x1=1;y1=1;x2=2;y2=10;x3=3;y2=20
plot(a,b) when both are vectors draws a line between each pair of indexes
x1=a(1);y1=b(1);...xn=a(n);yn=b(n);
Susan
2011 年 7 月 27 日
I am trying to plot two simple signals and then scale one down a bit so I will be able to see the both the same but one is shifted a bit.. My plot (a,b) and plot(f,z) works both perfectly fine but to do what I want I need to get the pair of value f,z together and find their actual value at each point then copy it to the pair x,y.. In matlab workspace x, y are both separate vector size 1x100 so to get the values and copy it to the other one and create identical plot with same exact values but second one is shifted by 3 I thought I should concatenate (a,b)and (f,z) so I can get the values and copy it to the other one. I did all that but now I want to see the result of what I was working on and thought since plot(x,y) works and all I did is concatenate them together plot(a) should be equivalent same for b so I can scale it etc.. Does that make sense now?.. Is my idea of achieving this wrong?
Fangjun Jiang
2011 年 7 月 27 日
@Susan, I recommend you going through the MATLAB help document "Getting Started" section to get yourself familiar with the basic MATLAB skills. Your previous question indicates you need those basic knowledge. I can't imaging it took 15 comments to figure out the "for k=1:100" syntax. You could just read the text from "help for". I can't understand your comment above. It is hard for me to breath too when I try to read it.
Susan
2011 年 7 月 27 日
Yeah, will try and read about it more and perhaps if I am too stuck ask more clear questions!! Matlab is too complicated !
Paulo Silva
2011 年 7 月 27 日
No Susan it isn't complicated, the problem is that too many users don't start by reading the basic documentation (me included) and often have to do something hard without the proper basis, MATLAB got the best documentation of any program you can get, all functions are documented and include examples.
Teachers should teach first how to use MATLAB basic functions and only after it ask students to use it for more difficult assignments.
Susan
2011 年 7 月 27 日
In my case was not taught Matlab at uni at all, we just learnt Java but was asked to use it for my actual project and trying to understand the pieces now so I can easily apply the whole methodology to the project hopefully but I do read about it but still need to read more but Thanks guys for your helps and advice :)
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
