How to know the value on the coordinates that i circled at MATLAB Function? Like (0,Y)=3.57

2 views (last 30 days)

Answers (2)

MJFcoNaN
MJFcoNaN on 1 May 2022
Interpolation on x=0 and y=0 (or any number you need); You may change the method from linear (default) to someone else.
x=0:0.1:pi/2;
y=-sin(x-1);
plot(x,y)
hold on
y0=interp1(x,y,0)
y0 = 0.8415
x0=interp1(y,x,0)
x0 = 1
plot(0,y0,'ro')
plot(x0,0,'bo')
grid on
  1 Comment
Dimas Lugia Hardianto
Dimas Lugia Hardianto on 1 May 2022
In my case, i want to know the value of coordinates that i circled to Display with MATLAB Function. I still don't understand the code in the MATLAB Function

Sign in to comment.


Walter Roberson
Walter Roberson on 1 May 2022
You have a voltage vs current plot. Those are independent unless being forced by something external. The values are only going to be 0 if the inputs are 0.
If you have more complicated inputs you could test for the coordinates being exactly zero or for there to be a change in sign() of the coordinates. If you had something like a sine wave you would not be able to just interp1 on the coordinates, as interp1 requires that the coordinates be monotonic.
  2 Comments
Dimas Lugia Hardianto
Dimas Lugia Hardianto on 1 May 2022
In my case, i want to know the value of coordinates that i circled to Display with MATLAB Function. I still don't understand the code in the MATLAB Function
Walter Roberson
Walter Roberson on 1 May 2022
Incorrect. Look at the plot: it is labeled I-V. Look at the plot: it is labeled as being an X-Y plot.
Look above the MATLAB Function in the diagram. Do you see the Product block? Do you see the Product block feeds into a rectangular block that has a circle inside it, and is labeled P-V? That is an X-Y chart.
In your original diagram there is another X-Y chart block above that which is plotting I-V using the I and V signals out of the PV module . It is that plot that you are looking at.
The Short Circuit Current block and the Open Current block in your diagram are numeric display blocks, not plots! And if they were plots then they would be labeled with the block name! Notice that those display blocks only have a single input, so even if they were plots they would only be able to plot the input versus time, not I vs V.
The code in the MATLAB Function Block is quite simple: at any given time, the outputs are the maximum of the first input that it has seen so far, and the value of the second input at that maximum, and the product of those two.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!