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

How to use `fmincon()` to solve the optimization using `l1` minimization
I am applying the answer from my earlier post On how to solve for the sparse OLS  how to apply `l1` minimization in Matlab (educational purpose)
I am trying to minimize the objective function
sum(residuals.^2) + \lambda*q
whereresiduals(n) = u(n)  u(n1)
andu(n) = r(n) (q(1)* u(n1) + q(2)* u(n2)+q(3)*u(n3)+q(4)*u(n4)+q(5)*u(n5))
. Herer
denotes the noisy output of the filter.The idea is to use
fmincon()
to obtain sparse coefficientsh
for the MA model given byy=filter(h',1,x);
where
x
is obtained by the nonlinear mapx(n)=4*x(n1)*(1x(n1));
Question1) How do I write the objective function
f
so as to pass it intoh_hat=fmincon(f,q,A,b)
Question2) Are the matrices
A
,b
correct? This is what I have tried but I am not sure if all the steps are correct because (a)h_hat
which are the estimates can be negative or not, I am not sure and (b) I dont know how to write outf
N=100; x(1) =0.1; h = [1,0.0,0.3,0.1,0.0,0.0]; M=6; %length of the channel for j=2:N x(j)=4*x(j1)*(1x(j1)); end y=filter(h',1,x); r = awgn(y,10,'measured'); %Initial estimate as guesses % assign an inital guess for the solution q1hat = 0.51; q2hat = 0.35; q3hat=0.1; q4hat=0.1; q5hat=0.1; q6hat=0.1; q = [q1hat; q2hat; q3hat; q4hat; q5hat;q6hat]; t=10; %l1restriction Len=length(q); A=zeros(power(2,Len),Len); for ii=1:power(2,Len) v=dec2bin(ii1,Len); for ij=1:Len A(ii,ij)=(str2num(v(ij))0.5)*2; end end b=ones(power(2,Len),1)*t; %solve h_hat=fmincon(f,q,A,b)

Ramanujan's Taxi (USING MATLAB)
Write a MATLAB script file that takes an argument n and prints all integers less than or equal to n that can be expressed as the sum of two cubes in two different waysfind distinct positive integers a, b, c, and d such that a^3 +b^3 = c^3 + d^3. Use four nested for loops.

Integration with symbolic variables as a constant
I am using symbolic toolbox for integration to obtain the expression which depends upon variables which are 'K' and 'sigma'.The integration variable is 'x'. The values of K varies from 0 to 1 and The values of sigma can be changed in the range from 0.03 to 0.2. In the code below, I want the expression y0 = f(K,sigma).
It is possible that there is no closed form expression exist. In that case, how should can I achieve the desired expression using any other technique?
Below is the Matlab code for my problem.
clear all syms x sigma K ; DC= 1i/sqrt(K+sigma*x); W = exp(0.5*x^2)/(sqrt(2*pi)) ; y0 = int(W*DC*(1),x,inf,inf) ;

Can't plot dates in graph with Python
I'm trying to plot a graph dates vs. counts. This is my code:
trip_data['start_date'] = sorted(trip_data['start_date'], key=lambda x: datetime.datetime.strptime(x, '%Y%m%d')) data_count = pd.DataFrame(data=trip_data['start_date'].value_counts().sort_index()) data_count.rename(columns={'start_date' : 'count'}, inplace = True) data_count.reset_index(inplace=True) data_count.rename(columns={'index' : 'start_date'}, inplace = True) data_count.plot()
And I get this graph:
So clearly the dates won't plot correctly, they just add up as int. I've tried a number of solutions I've found on Google and here on Stackoverflow, but none seems to work. The majority of them also had stripping dates as the main point, but as the code shows that has already been done. Plotting a hist graph also reverses the x and y axes, if that's useful. Any thoughts? Thank you in advance!

R drawing a barcode by giving the explicite position where to draw the black lines
Is there any function to draw a barcode with R, which takes the height (or say the width = the number of lines) and the position where to draw a black lines.
Thanks for your help.
David.

Plot formatting
I want to plot a Histogram chart using python after filtering data. I use the following code:
B1WL = H11B1[H11B1.index.dayofweek == 0] B1WL['LaborReq.Actual Hrs'].hist(by = B1WL['WorkPackage_Aircraft_Fleet'], color='black', histtype='bar', normed=True, label='B1 Skill  744 fleet')
How to give proper spacing such that the labels are clearly visible. Sorry I could not figure out how to fix it. Any help would be appreciated.

server integration on browser using webRTC technology
i am working on video calling web based application using webRTC technology, video is straming on the browser, i have studied completey but dont know how to set up erve and integrate with javacript

Has anyone ever worked with a product called 'Linksync'?
I have a woocommerce site and it needs to integrate with the Vend POS system. I tried to use the dsync system https://app.dsync.com but that was very unreliable. I now tried Linksync https://linksync.com , which worked fine at first but now has issues.
Unfortunately, they have disappeared off the planet, no answer to any support queries, no answer on the telephone or email, just disappeared!
On a note, I HATE companies like this. They are still taking their $100 a month for the service but with no support and no one to ever talk to so anyone even thinking of using them AVOID.
But in regards, I'm looking for anyone who has experience in this system that cab help. A load of products no longer sync with Vend for some reason even through the order sync is working.

I need Efficient RegularGridInterpolator because I need to call it each integration step
I'm integrating the equation of motion for particles moving in a flow field so I need to know the fluid velocity at each time step in 3D. Thus, I'm using RegularGridInterpolator in Scipy to do so. However, to calculate a single particle trajectory I need about 10 seconds, which is too much. When I profiled my code I saw that most of the time 90% is taken in the interpolation. As there anyway I could make my code 100 times faster? Thanks