フィルターのクリア

Plot is generating a series of vectors instead of a continuous line plot

1 回表示 (過去 30 日間)
Andrew Stark
Andrew Stark 2020 年 11 月 15 日
コメント済み: Star Strider 2020 年 11 月 15 日
for i=1:1000
plot(Df{i,:},Zf{i,:})
hold on
end
Both Zf and Df look like this but continue to 1000; however, the values within the matrix are different. I was wondering if there was a way to make the plot look like a continuous line for each row instead of a series of vectors? For example for line 1 the plot looks like 143 vectors coming from 0 instead of 1 continuous line.
  1 件のコメント
Andrew Stark
Andrew Stark 2020 年 11 月 15 日
The issue is that when I plot line after line of Df against Zf it treats each point as a seperate vector instead of 1 continuous line

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

回答 (1 件)

Star Strider
Star Strider 2020 年 11 月 15 日
I have no idea what ‘Df’ and ‘Zf’ are, so I created one of them and simulated the data:
Zf = {rand(143,1); rand(380,1); rand(164,1)}; % Create Data
Zfsz = cellfun(@(x)size(x,1), Zf); % Lengths Of Individual Cells
accum = cumsum([1;Zfsz]); % Concatenate '1’ & Accumulate Sum
figure
hold on
for k = 1:numel(Zf)
plot(accum(k):accum(k+1)-1, Zf{k})
end
hold off
This does what you want with my simulated data, however you will need to integrated it with your data.
  2 件のコメント
Andrew Stark
Andrew Stark 2020 年 11 月 15 日
I believe that sets each step as the x axis but I want the x axis to be Zf while the y axis is Df and then the steps is just the path that the line takes if that makes sense?
Star Strider
Star Strider 2020 年 11 月 15 日
Since I have absolutely no idea what ‘Df’ and ‘Zf’ are or the result you want, I can go no further.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by