이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
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일
1 개 추천
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!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)
