Tag : matlab

I am a beginner in the field of lithium-ion battery system research. the Urban Dynamometer Driving Schedule (UDDS) is a specific driving condition of electric vehicle, which is composed of a series of data of speed versus time. Now, I want to use the UDDS to simulate the dynamic discharging process of a series-connected lithium-ion battery pack. How do I convert this data of speed versus time of UDDS into the corresponding data of battery current versus time? For example, in the link, https://github.com/Zhouzihao914/Equivalent_Circuit_Model_Battery/tree/main/udds, how is the udds_curr.mat obtained from the udd..

Read more

I wrote a function caterpillar that takes arrays of x and y values and plots several circles following the line described by the coordinates. Next I need to write a function that will make the caterpillar move inside a rectangle for an input number of iterations. My problem is that I cannot figure out a simple way to calculate the path it would take. When caterpillar reaches the boundaries of the rectangle it should reflect and go in another direction. I am trying to create the whole trajectory beforehand, put it into an array and then feed to caterpillar. I was thinking of somehow using minus signs as to represent reflections but I don’t know how to update my x and y coordinates appropri..

Read more

I have a Matlab script which plots data in two subplots and allows me to click interactively on any data point using datatip and outputs the x,y info of that point. Running the code below, clicking on a data point using datatip and then pressing Enter will output the x,y value of that point in the Command Window. I can do this for any number of points till the loop ends or I manually close the figure window. Figure 1 and Figure 2 show me clicking on one point each from left and right subplot, respectively, and the information can be seen below at the bottom of the figures.
Is there a way in which I can make Matlab also output which subplot I am clicking on ? For example, it should output x,y, and 1 or 2 in which 1 or 2 are subplot in..

Read more