I want to plot X & Y data for different Time step.
2 ビュー (過去 30 日間)
古いコメントを表示
Any one could help me> I am very new at matlab.
I'm trying to figure out a way to show in a scatter plot. I have excel and text file data file where at 900 sec I have 44 xy points, at 950 sec 234 points,....., at 1150 sec 260 points. How can I do that.
Example data:
# THIS IS A EXTINCTION PLOT FILE
# The Time Passed = 900
# The Volume Entered = 0.000156572
XPOS YPOS AF
0.22 0.105 0.00000D+00
0.215 0.105 0.00000D+00
0.215 0.105 0.00000D+00
0.21 0.105 0.00000D+00
0.205 0.105 0.00000D+00
0.205 0.105 0.00000D+00
0.14 0.095 0.00000D+00
0.135 0.095 0.00000D+00
....
....
0.23 0.095 0.00000D+00
0.23 0.1 0.00000D+00
0.225 0.105 0.00000D+00
0.22 0.105 0.00000D+00
# THIS IS A EXTINCTION PLOT FILE
# The Time Passed = 950
# The Volume Entered = 0.000156707
XPOS YPOS AF BF CF
0.22 0.105 0.00000D+00
0.215 0.105 0.00000D+00
0.215 0.105 0.00000D+00
0.21 0.105 0.00000D+00
0.205 0.105 0.00000D+00
....
0.23 0.075 0.00000D+00
0.23 0.08 0.00000D+00
0.23 0.08 0.00000D+00
0.23 0.085 0.00000D+00
0.23 0.09 0.00000D+00
0.23 0.09 0.00000D+00
0.23 0.095 0.00000D+00
0.23 0.1 0.00000D+00
0.225 0.105 0.00000D+00
0.22 0.105 0.00000D+00
0 件のコメント
採用された回答
Geoff
2012 年 4 月 1 日
How about this:
hold off;
scatter( x1, y1, 'bo' ); % Blue circles
hold on;
scatter( x2, y2, 'gv' ); % Green triangles
scatter( x3, y3, 'rs' ); % Red squares
hold off;
legend( '900 seconds', '950 seconds', '1150 seconds' );
The hold on command will cause new plots to be added to the existing figure.
0 件のコメント
その他の回答 (3 件)
Tan Has
2012 年 4 月 2 日
2 件のコメント
Geoff
2012 年 4 月 2 日
Does your data have a column of time values in it? The usual thing to do (let's say that column 4 has the time) is:
t = M(:,4);
x900 = xarray(t==900);
x950 = xarray(t==950);
... etc
Otherwise, if you really want to read different data lengths and you know the lengths already, don't use those formulae for 'm' and 'n'. Just do one read for each set. That is, hard-code the row and column into multiple calls to 'dlmread'.
Geoff
2012 年 4 月 2 日
Sorry, I forgot you had given a sample data file. The easiest way for you to proceed will be to hard-code the numbers as in my second suggestion above.
Tan Has
2012 年 4 月 2 日
1 件のコメント
Geoff
2012 年 4 月 2 日
That's what 'hold on' does. It plots onto the same axes as the last plot. You have a lot of questions, and it is not helpful to post them here. Post a new question when you need to know something, so that other people can search for relevant answers if they want to do the same thing.
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!