Y-axis value of plot is stored as zero

Hello,
I am performing a computation and plotting the result.
I have three signals, FA, FB and C (15223x1 complex double). I am computing the output signal such that,
Op = C .* FB / FA
Now I am plotting the output Op (15223x15223 complex double) against time (15223x1 double). By default, matlab ignores the imaginary parts of complex Op which is fine by me.
I am getting a plot, although the variable Op stores 0 (15223x15223 complex double). Now I need to perform further computations with Op and I am not able to do that as it contains only zero.
Why is it storing zero?
Also I have tried to extract the values of axes from the plot, which again contains only zero.
What am I doing wrong? How should I proceed? Pls help me.

6 Comments

What are you expecting the results of all this to be? You are using a plot rather than an image so I assume you are expecting a vector result? If so I would guess you need to use
./
not matrix division in
Op = C .* FB ./ FA
Or are you really expecting to have 15223 plots on a single graph?
If you expect a single vector then you should be stopping when you get Op as size 15223x15223 which is clearly wrong, rather than just carrying on with it anyway!
I am supposed to use matrix division. Also my output plot matches with my theoretical output. So I guess matrix division is correct and I am not expecting a single vector.
So I will be getting 15223 plots. Now when I extracted the axes values of these 15223 plots, the y axis value was 0 in each of them.
Also what do you mean by 'You are using a plot rather than an image'? Is there any other way to plot this? Sorry if I am being obtuse.
Well, using something like
doc imagesc
is more usual if you want to plot a matrix, especially one that big as there is no way you would be able to understand 15223 line plots all on top of each other, even if they did contain the correct data.
If the data you are extracting from the axes is wrong then so is the result that went into them - i.e. Op so that is where something is going wrong with the calculation.
You should always use your original data when you have it. Extracting data from a plot to do further calculations on is a last resort unless you are actually drawing on a plot or image and extracting from that.
imagesc displays a color bar. I would like a plot to be displayed as op is voltage and I would like to visualize the variations.
Moreover, matlab displays a plot of op with non zero values. But the value stored by matlab in a variable and also the value extracted from the plot was zero! How is that possible?
What I would like to know is how to extract the non zero y axis value that the graph seems to display? Is it feasible?
Thanks.
If Op is what you are plotting then that is where your data is. If non-zero components appear in the plot then they are in Op too.
What you seem to be saying though is you have 15223 plots, of which only two are different, judging by your plot?
You can look at
real( Op )
and find the row/column of non-zero values. You can sum along columns or rows (possibly the abs) and ignore all below a threshold if the rest are close to 0, but not precisely zero
Thanks. I found out the nonzero values by the sum of the columns of 'Op'. Although I already found it a few days before but ignored it considering they were of the order e-07 and hence close to zero. I forgot that my graph was also scaled the same way!
Anyways, thanks a lot.

Sign in to comment.

Answers (0)

Products

Release

R2017a

Asked:

on 25 Apr 2019

Commented:

on 29 Apr 2019

Community Treasure Hunt

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

Start Hunting!