# Recent content by confused_engineer

1. ### Mathematica Defining a piecewise function in Mathematica

Thank you very much. That was it.
2. ### Mathematica Defining a piecewise function in Mathematica

Hello everyone. I am trying to do a 2D Shannon interpolation, but I cannot use a sinc because later on this expression goes in an optimization software that doesn't recognize it. I have defined my own version of sinc as: sincC = Piecewise[{(Sin[Pi* #]/(Pi*(#))), # >= 1}, {1 - (#^2)/6 +...

Don't worry. In the end, I found out a way to do it using Shannon sampling in two dimensions. However, I am running in some issues, but I think they deserve their own thread

The thing is that I cannot use piecewise interpolation, the result goes then into ampl, an optimization software (in which I am calculating the fastest route) which needs to know the value of the windspeed at all points. I need an algebraic expression of the windspeed, in this case, my f(x,y)...

First of all, thanks for the answer. Second, my data doesn't have noise, since the data is the output of a prediction model (I don't know anything about it's internal working, only the output file), so I will try the lineal way instead. About the use of interpolation instead of the fit, I do...

Hello everyone. I have a vector of size 300321*3; the columns are X position, Y position and recorded data; I need to find the interpolation polynomial. I have acess to mathematica, matlab and python. I have attempted to use a NonlinearModelFit in mathematica, but I cannot achieve a Rsquared...
7. ### I Differences between the PCA function and Karhunen-Loève expansion

Hello everyone. I am currently using the pca function from matlab on a gaussian process. Matlab's pca offers three results. Coeff, Score and Latent. Latent are the eigenvalues of the covariance matrix, Coeff are the eigenvectors of said matrix and Score are the representation of the original...
8. ### Question about the PCA function

Greetings everyone. I have generated a gaussian random process composed of 500 realizations and 501 observations. The used random variables are gaussian normal. I have then applied the pca analysis to that process (Mathwork's help). However, if I plot the histograms of the coeffs I don't find...
9. ### Problem with random variables in Matlab's PCA

Hello. I have designed a Gaussian kernel as: [X,Y] = meshgrid(0:0.002:1,0:0.002:1); Z=exp((-1)*abs(X-Y)); Now, I calculate PCA: [coeffG, scoreG, latentG, tsquaredG, explainedG, muG]=pca(Z, 'Centered',false); I can rebuid the original data propperly as defined in the dcumentation...
10. ### I Karhunen Loeve Expansion in Matlab

Hello everyone. I am trying to generate the KL expansion of a stochastic process. I use a Monte Carlo sampling method to generate the process, which involves two random variables and I compare it with it's theoretical mean for 50 values of time and they look quite similar. Then, I calculate the...
11. ### Mathematica Storing Mathematica output

Yes, this seems to work. Thanks.
12. ### Mathematica Storing Mathematica output

Hi. I want to store the output of Roots[LegendreP[3.0, x] == 0, x] as a vector. Can someone help me? Thanks
13. ### MATLAB How to program this in Matlab

I think that I have it. Thanks for the help, you have helped me a big deal.
14. ### MATLAB How to program this in Matlab

Hello everyone. I am trying to create a matrix in Matlab with two columns which should look like as follow: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9... 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1... Has anyone programed something like this before?
15. ### Unusual date format

Hello everybody. Recently I have been given a series of archives which contain a series of measurements and the dates in which they were measured. The problem is that this format is the time which has happened in hours since 1900-01-01 at midnight. Can someone tell me how can I find out how to...