Matlab plotting errors when trying to compute integral and double integral
My Code
M=dlmread('C:\Users\distanceY.data','\t');
xaccel=M(:,5);
time = 0:0.05:781.45;
figure
plot(time,xaccel)
title('Acceleration')
xlabel('Time')
Z=cumtrapz(time,xaccel);
figure
plot(time,Z)
title('Velocity')
xlabel('Time')
W=cumtrapz(time,Z);
figure
plot(time, W)
title('Distance')
xlabel('Time')
It gives me errors
Error using plot Vectors must be the same length.
Error in Graph2 (line 5) plot(time,xaccel)
See also questions close to this topic

Curve Fitting Second derivative Gaussian
I have the following two columns with data 'X' and 'Y'. I need to do a fit based on the 2nd derivative of Gaussian (Mexican hat). Also, the fitting procedure should be able to give out the parameters in a cell for different spectrums. I have huge amounts of different data (also contains NaN) but important for me is to use exactly the same FWHM for all fittings. So, the fitting procedure should have a possibility for this constraint. I thought to get an expert opinion on this for an efficient solution with very less computing time. Please, for a testing as large dataset, just repeat both columns for a bigger range. (availability= 'nlinfit') Thank you very much!
X Y 9 0.2047 10 0.2014 14 0.2944 22 0.4893 27 0.5433 32 0.47 37 0.2516 56 1.1604 63 1.4507 71 1.1809 91 0.3434 99 0.7094 102 0.7002 106 0.5832

For loop storing values in MATLAB
I have asked a similar question before, see,
Double for loop in MATLAB, storing the information
I am storing the results from a for loop but this time my for loop numbers do not increase by one each time.
%% for q = [25,50,100,250,500,5000] ActualTable(:,q)=ActualValues; end
As you will see this code runs but it has large portions of rows in the matrix
ActualTable
which only contain0
's I would just like the rows that contain nonzero. So it is saving every single row from 25 to 5000 and only inserting my values in the25, 50, 100
etc rows with all other rows containing a zero. 
Building table with specifik data
I need some help with a task that I have:
I have 4 vectors with data: 3 of them are with dates and the 4th one is with overdue days, something like this:
dateAdded dueDate date overdue Published 02/11/18 02/11/18 03/11/18 1 03/11/18 04/11/18 11/11/18 7 03/11/18 04/11/18 04/12/18 30 04/11/18 05/11/18 ongoing overdue up to today
Can you give me some tips how can I create a table with the overdue days for each month from the year, considering that when I have transition from one month to another one I have to count the overdue to both months? Also when the datePublished hasn't come yet I have to count the overdue dates for each month passed.
Thanks

Possible to "trace" block of noisy data?
I have a very noisy, very large set of data (astrophysics). It is a csv data set with shape (815900, 2). I am trying to find a good gradient for the very top "shape" if you will of the data, whilst essentially ignoring all the noise below it. I would like to find out if there is a way to "trace" the "shape" of the top of the data and make that a simple line. I apologise that this is a bit handwavy. This is the data, and I care about the top contour of it, as highlighted in green here. The green is just a scatter plot I made almost by accident, so it can be ignored. I only use it to illustrate what I mean when I say trace/shape/contour. I tried to do a simple linear regression but all the noise below shifts it down (that's the orange line you see).
Thank you very much in advance, and I apologise for this being fairly abstract.

How to get labels and axis titles on all subplots (python)
What am I doing wrong here? Tried reading through all the previous answers to the same problem but could not figure out what the problem is, why does the legend etc only go on the last subplot? Probably a really simple thing I'm missing here..
#Create subplot fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(12,8)); axes #parse into own variables ax11 = axes[0][0] ax12 = axes[0][1] ax21 = axes[1][0] ax22 = axes[1][1] # Set plot line width line_width = 1.5 # Plot data ax11.plot(winter_temps, label='Winter') plt.legend() plt.title('Anomaly in temperature during winters 19532016') plt.xlabel('Months') plt.ylabel('Temperature anomaly (Celsius)') ax12.plot(spring_temps, label='Spring') plt.legend() plt.title('Anomaly in temperature during springs 19532016') plt.xlabel('Months') plt.ylabel('Temperature anomaly (Celsius)') ax21.plot(summer_temps, label='Summer') plt.legend() plt.title('Anomaly in temperature during summers 19532016') plt.xlabel('Months') plt.ylabel('Temperature anomaly (Celsius)') ax22.plot(fall_temps, label='Fall') plt.legend() plt.title('Anomaly in temperature during falls 19532016') plt.xlabel('Months') plt.ylabel('Temperature anomaly (Celsius)') # Set yaxis limits ax11.set_ylim(min_temp, max_temp) ax12.set_ylim(min_temp, max_temp) ax21.set_ylim(min_temp, max_temp) ax22.set_ylim(min_temp, max_temp) # Turn plot grids on ax11.grid() ax12.grid() ax21.grid() ax22.grid()
It all also gives me the error:
No handles with labels found to put in legend.
So the thing is I want the legend, axis titles and plot title to each subplot.

Is there a way to plot a reference vector from a subplot in the overall figure?
I have nine plots within the same figure that contain wind vectors and some contoured values. I am able to plot the colorbar to the right of the figure without issue, but I need to find a way to put a reference vector in the same area.
The current code that I have only puts the vector on one plot with the quivermc 'units' and 'm/s' inputs, which alters the positioning of the plot that it is declared in and isn't easily scalable.
Is there a way to create a reference vector for all plots or is there a way to move the existing reference vector from its position on Type 9 to a new location?
Apologies if this is easily answered, but I haven't used Matlab before and am working with a colleague's code who left the company a while back.
RHcol = cbrewer('div', 'BrBG', 200) figure subplot(3,3,1), setMap, contourfm(lat2,lon2,rh850_1,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type1'); subplot(3,3,2), setMap, contourfm(lat2,lon2,rh850_2,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type2'); subplot(3,3,3), setMap, contourfm(lat2,lon2,rh850_3,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type3'); subplot(3,3,4), setMap, contourfm(lat2,lon2,rh850_4,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type4'); subplot(3,3,5), setMap, contourfm(lat2,lon2,rh850_5,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type5'); subplot(3,3,6), setMap, contourfm(lat2,lon2,rh850_6,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type6'); subplot(3,3,7), setMap, contourfm(lat2,lon2,rh850_7,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type7'); subplot(3,3,8), setMap, contourfm(lat2,lon2,rh850_8,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type8'); subplot(3,3,9), setMap, contourfm(lat2,lon2,rh850_8,20,'LineStyle','none'), caxis([0 100]), setMap, colormap(RHcol),title('Type9'); subplot(3,3,1), setMap, quivermc(lat2,lon2,u850_1,v850_1,'density',25),setMap; subplot(3,3,2), setMap, quivermc(lat2,lon2,u850_2,v850_2,'density',25),setMap; subplot(3,3,3), setMap, quivermc(lat2,lon2,u850_3,v850_3,'density',25),setMap; subplot(3,3,4), setMap, quivermc(lat2,lon2,u850_4,v850_4,'density',25),setMap; subplot(3,3,5), setMap, quivermc(lat2,lon2,u850_5,v850_5,'density',25),setMap; subplot(3,3,6), setMap, quivermc(lat2,lon2,u850_6,v850_6,'density',25),setMap; subplot(3,3,7), setMap, quivermc(lat2,lon2,u850_7,v850_7,'density',25),setMap; subplot(3,3,8), setMap, quivermc(lat2,lon2,u850_8,v850_8,'density',25),setMap; subplot(3,3,9), setMap, quivermc(lat2,lon2,u850_9,v850_9,'density',25,'units','m/s'),setMap; h = colorbar('location','Manual', 'position', [0.93 0.135 0.03 0.15]); title(h,'RH%');

how to integrating Multivariate Normal distribution Density?
I'm trying find a solution to integrate Density of multivariate normal distribution.
I have 100 points dataset (x,y) and a covariance matrix (sigma) of these data I have an idea to integrate density that I integrate each value of covariance matrix (x[i] to x[j]) and then sum all integrated values. Is it correct?def gaussian(x, mu, sig): return np.exp((x  mu)**2/ (2 * sig**2)) I = np.zeros(len(sigma), dtype=float) for i in range(0, len(sigma)): I[i] = quad(gaussian, x1[i] , x1[i+1] , args=(0, sigma[i]))[0] sum(I)

triple integration over arrays python
I have the following triple integral:
the data are: t 1D array(size 124) , pr 1D array(size 10), lat 1D array(241) and lon 1D array(size 480) V 4D array (124, 10, 241, 480)
I want to integrate v over t, pr and lon at each lat So, I used the following code:
def M(T, lam, P, V, phi): return integrate.tplquad(V*R*np.cos(phi), 0, T, lambda T: 0, lambda T: lam, lambda T,lam: 0, lambda T,lam: P)[0] for i in range(lat.shape[0]): a = M(t, lon, pr, v[:, :, i, :], lat[i])
But I got error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
How tplquad works is still confusing for me. Any help with doing the integral with tplquad or other functions?

How to find the amazon MWS wsdl
I'm trying to create a integration between SAP PI and Amazon MWS to get order information back on a periodical timeframe, to process the orders into SAP as order05 idocs. I dont seem to be able to locate the MWS wsdl to play about with in SOAPUI. Could anyone advise how i can find this?
Thanks